Changing the message (or exception) in WPF ValidatesOnException binding

Posted by Emad on Stack Overflow See other posts from Stack Overflow or by Emad
Published on 2009-07-14T18:30:04Z Indexed on 2010/05/03 5:08 UTC
Read the original article Hit count: 494

Filed under:
|

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 ?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about validation