Reputation: 9394
I have a TextBox where the Text-Property is binded to a double-value. Now I want to check if the validation of the TextBox is ok in the viewmodel. I currently have no idea how to do this.
How can I do this?
Upvotes: 0
Views: 241
Reputation: 1347
And for validate use IDataErrorInfo (read more: http://blogs.msdn.com/b/wpfsdk/archive/2007/10/02/data-validation-in-3-5.aspx)
Upvotes: 2
Reputation: 116
WPF can handle basic validation for you automatically, there will be cast exception in case of wrong user input.
For more elaborated validation you can use IDataErrorInfo. See for example http://codeblitz.wordpress.com/2009/05/08/wpf-validation-made-easy-with-idataerrorinfo/
Upvotes: 0