Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Data Validation? Anything out there better than IDataErrorInfo?

Is there a preferred practice to do Data Validation from within your ViewModel?

Looking into it some people seem to prefer IDataErrorInfo and some prefer to roll out their own validation frameworks (http://www.codeproject.com/KB/WPF/wpf_custom_validation.aspx)?

I'm wondering what the "Best Practice" is for Data Validation? Is there something that is accepted by the community when it comes to adhering to the M-V-VM guidelines?

Oh, and an FYI, I'm using Prism as my MVVM framework, but I don't think it has any laid out code for Validation assistance.

like image 404
michael Avatar asked May 23 '11 19:05

michael


1 Answers

You might use the Validation Framework of the .NET Framework. It can be used with PRISM or any other MVVM Framework. The BookLibrary sample application of the WPF Application Framework (WAF) shows how to use it together with WPF Binding.

like image 101
jbe Avatar answered Nov 13 '22 02:11

jbe