Support for Validation Notifications

Topics: Validation Application Block
Sep 12, 2007 at 5:31 PM
Validation is external to the object being validated. A way to register to notifications would add great benefits, mainly when the object is data bound.

interfacte IValidationNotifications
void NotifyValidationOccured(ValidationResults results);
event EventHandler<ValidationEventArgs> Validated;

class ValidationEventArgs : EventArgs
public ValidationResults Results { ... }

At the end of the validation process, if the target being validated implements the interface, it would Notify of ValidationResults.

One way to implement that would have been to decorate validators (the same way instrumentation works) would an additional Validator that implements that logic. However there is no way to specify additional (default) decorators.