Following the answer of Ragepato.
The easiest way to do this is to create your own Binding , which inherits from Binding , and then set the things you need, for example NotifyOnValidationError="True" and ValidatesOnDataErrors="True" in the constructor.
public class ExBinding : Binding { public ExBinding() { NotifyOnValidationError = true; ValidatesOnDataErrors = true; } }
And then instead you use this binding
<TextBox> <TextBox.Text> <local:ExBinding Path="PostalCode"> <local:ExBinding.ValidationRules> <rules:PostalCodeRule /> </local:ExBinding.ValidationRules> </local:ExBinding> </TextBox.Text> </TextBox>
Fredrik hedblad
source share