I\'ve messed around with PreviewLostKeyboardFocus
which almost gets you there. I\'ve seen a couple of implementations using LostFocus
, but that just f
To add onto Ray's answer:
UpdateSource is called like so:
BindingExpression be = userTextbox.GetBindingExpression(TextBox.TextProperty);
be.UpdateSource();
Also, as an alternative you can set the text box binding to:
UpdateSourceTrigger = "PropertyChanged";
The latter will cause a continuous check, whereas the former will check when needed (performant).