Adding INotifyDataErrorInfo Support to the ValidationSummary Control

Now that you have looked at the INotifyDataErrorInfo interface and at the inner workings of the custom validation system, let us examine how the ValidationSummary control has been extended to support the INotifyDataErrorInfo interface.

As you saw in the previous section, the ValidationSummary control monitors its data context for validation errors if the data context implements INotifyDataErrorInfo. When the INotifyDataErrorInfo.ErrorsChanged event is raised by the data context, the control’s HandleErrorsChanged handler is called (see Listing 26.5).

ValidationSummary maintains a dictionary of validation errors, which are keyed by the associated property name. The HandleErrorsChanged ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.