I have two textboxes. The values are bind from properties:
<TextBlock Text="Input 1" Margin="3,3,3,3" FontWeight="Normal" Foreground="#FFF4E7CA"/>
<TextBox Text="{Binding Processing.Input1}" Margin="3,3,6,3" FontWeight="Normal"/>
<TextBlock Text="Input 2" Margin="3,3,3,3" FontWeight="Normal" Foreground="#FFF4E7CA"/>
<TextBox Text="{Binding Processing.Input2}" Margin="3,3,6,3" FontWeight="Normal"/>
After changing the values in the first textbox, I press on "Save" button. the value of the Textbox1 will be not updated on the saved result. Only if I move the mouse focus from textbox 1 after editing to Textbox 2. then the result got updated. How can I get the textbox updated to the property immediately?
TextBoxby default updates the binding source on LostFocus. It seems thatTextBoxdoes not lose the focus by pressing the “Save” button.You can update the binding source immediately after every change with:
or update the binding source explicit on “Save” button click: