I am building a WPF 4 application with Prism and MVVM, I have some POCO to bind with different views in different modules. I would like to implement validation of user input.
After I have done tons of search I found all of the implmenetations are based on property changed and validation logic kicking off right away. And typical way is to leverage attributes under System.ComponentModel.DataAnnotations namespace and IDataErrorInfo
My requirements are:
- I don't want object to be validated until I click on some button. If I call Validator.TryValidateObject from my event handler, it does not seem that UI control can be notified with the errors.
- I need different validation rules agaisnt same object in different modules/views. For example a field in module A is optional; but mandatory in module B.
Anybody has some good suggestion, articles to describe my requirements?
Welcome to help me with my open source project at http://code.google.com/p/batch-image-watermark-processor/
View Complete Post