I want to have a textbox append a specific string once the user tabs out of the control, i.e. LostFocus, however I prefer the textbox to validate as the user types, so UpdateSourceTrigger
is set to PropertyChanged
.
Is there a way to get this to work in WPF?
Looked at this question which is similar but wondering if there is a cleaner solution?
My XAML is:
<TextBox Text="{Binding Path=MyBindingPath,
StringFormat='\{0} -HELLO',
TargetNullValue={x:Static sys:String.Empty},
ValidatesOnDataErrors=True,
NotifyOnValidationError=True,
UpdateSourceTrigger=PropertyChanged}"/>