Bindings in WPF have the " UpdateSourceTrigger " property , which tells Binding when the item that the user interface is associated with is updated. By default, it is set to "LostFocus" for the Text property, which you most likely use.
Change the trigger to "PropertyChanged" in your binding, for example:
Text="{Binding Foo,UpdateSourceTrigger=PropertyChanged}"
... and now the original "Foo" property will be updated as the text in the user interface changes.
There is also an Explicit parameter for UpdateSourceTrigger, which is convenient if you need to pause writing any changes to the source until, say, the user clicks the OK button.
source
share