data binding - WPF databinding after Save button click -
i have app , settings window tabcontrol containing couple of tabitems. each of them have fields (textboxes) databinded same singleton object.
there elegant , wpf-like way the databinding after save button click?
right it's databinded after changing content of textbox, , want singleton have old values , update them after clicking save button.
for databinding object used in xaml textbox, use updatesourcetrigger property value explicit below:
<textbox name="itemnametextbox" text="{binding path=itemname, updatesourcetrigger=explicit}" /> when set updatesourcetrigger value explicit, source value changes when application calls updatesource method below (you can put below code in save click event):
bindingexpression = itemnametextbox.getbindingexpression(textbox.textproperty); be.updatesource();
Comments
Post a Comment