Changing the message (or exception) in WPF ValidatesOnException binding
- by Emad
I have a WPF application using MVVM.
I am using binding to a POCO object.
The Textbox is bound to a property in the object like:
<TextBox.Text>
<Binding Path="CertainProperty" Mode="TwoWay" >
<Binding.ValidationRules>
<ExceptionValidationRule/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
Now this property is a a int property and when the user tried to enter a non-numeric value, they get the "input string was not in a correct format".
What I need to do is customize this message to a more user friendly one.
How can I do that ?