WinForms Error BindingI created a component that handles the boring job of hooking up an object that implements IDataErrorInfo to an ErrorProvider on a form. The data bound object has to implement my IRuleTrigger interface by having two events RuleInvalidated and RuleValidated. These events are listened to by my RuleBinder component. It then enumerates the controls on the form looking for data bindings relevant to the data object. ErrorProvider.SetError is invoked to either set or clear the error on controls as needed.
So now the business object is in control of business rules and the RuleRinder takes care of setting the relevant UI. Thus eliminating all those TextBox.Validated event handlers.
If I get the code commented up properly (when I'm less busy) I'll post it online. It looks like I'm building up a fair amount of code here for a rather nice "Data Binding Framework" library.