The easiest way to do this is to use the UpdateSourceTrigger property for binding. You may not be able to exactly match your current behavior, but you may find that it is comparable.
The UpdateSourceTrigger property determines when the binding object updates the source. Different WPF controls have different default values ββfor this property when binding.
Here are your options:
UpdateSourceTrigger.Default = Allow target control to define UpdateSourceTrigger mode.
UpdateSourceTrigger.Explicit = Use only the update source when someone calls BindingExpression.UpdateSource ();
UpdateSourceTrigger.LostFocus = automatically update the binding source whenever the target loses focus. Thus, the change can be completed, and then the binding is updated after the user proceeds.
UpdateSourceTrigger.PropertyChanged = Whenever DependencyProperty on the target of a value change, the source is updated immediately. Most UserControls do not use this property by default because it requires more binding updates (there may be a performance issue).
Josh g
source share