Considerable efforts have been made to keep the control as easy to use as the WinForms ErrorProvider (and I believe, with success). Lastly, this control is more or less a hybrid of Paul Stovell's and Buzz Weetman's controls, adding many features and flexibility to both of them. For another, that approach was not standardized, and so I decided to use VAB instead.
Cannot provide errorprovider on winforms code#
For one thing, they required me to implement procedural code for validation. Here, my approach is different from Paul Stovell's article, as he uses custom Rule classes for validation. That was when I decided to use the Validation Application Block as a way to declare validation rules, and use the IDataErrorInfo interface to validate those rules. However, the declarative approach for validation used in ValidationRule was always alluring. NET support for IDataErrorInfo, I was almost certain to use it as the source for providing errors in business objects.
![cannot provide errorprovider on winforms cannot provide errorprovider on winforms](https://cruxinsiders.com/wp-content/uploads/2019/01/How-to-use-Error-Providers-with-Regular-Expression-in-WinForm-control-validation-C-e1554246318236.jpg)
Rules should not be implemented in property setters.A business object should be allowed to be invalid, so long as you don't try to save it.I am stating them again below (borrowed as is from that article): Specifically, my high level design goals for the Validation control were derived from this Paul Stovell article. There was not much in these articles that I could disagree with. After Googling out, I found links to Validation in Windows Presentation Foundation, Validizor - A Validation Control for WPF, and Delegates and Business Objects. As soon as I started with WPF, I needed Validation, and WPF provides me no control for this. This control is more of an inspirational one, than an innovational control. ErrorProvider is a WPF control that attempts to integrate the best features of WPF, the IDataErrorInfo interface, and Microsoft's Validation Application Block.