WPF Implementing Validation INotifyDataErrorInfo

INotifyDataErrorInfo Before diving into implementation of INotifyDataErrorInfo, make sure you have a good grasp of WPF Data Binding. 3 important usage/returns of INotifyDataErrorInfo interface: HasErrors - bool property that is binded when the Model has any error. GetErrors - IEnumberable ErrorsChanged - Event Let’s create a model (Person class) that implements INotifyDataErrorInfo class Person : INotifyDataErrorInfo { public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public System.Collections.IEnumerable GetErrors(string propertyName) { } public bool HasErrors { get { return true; } } } Let’s define a dictionary errors...

December 12, 2013 · 1 min · Jommel Colcol