c# - Textbox - bound property value does not update immediately -
i have textbox bound property itemid
so.
private string _itemid; public string itemid { { return _itemid; } set { _itemid = value; } }
the xaml of text box follows:
<textbox text="{binding path=itemid, mode=twoway}" name="txtitemid" />
the problem is, value of itemid
not update type,
causing add
button disabled (command), until lose focus of text box pressing tab key.
yes, default, property updated on lost focus. improve performance avoiding update of bound property on every keystroke. should use updatesourcetrigger=propertychanged.
try this:
<textbox text="{binding path=itemid, mode=twoway, updatesourcetrigger=propertychanged}" name="txtitemid" />
you should implement inotifypropertychanged interface viewmodel. else, if property changed in viewmodel, ui not know it. hence not updated. this might in implementation.
Comments
Post a Comment