المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Usage of IDataErrorInfo



C# Programming
05-21-2013, 01:01 AM
Hello All
I am trying to implement MVVM and use IDataErrorInfo interface to validate data in the model classes

I base model class implementing IDataErrorInfo interface

public class BaseClass: IDataErrorInfo { #region IDataErrorInfo public string Error { get { return String.Empty; } } public string this[string PropertyName] { get { return this.GetValidationError(PropertyName); } } #endregion }
Now I want drive a class from Base class

public class DrivedClass: BaseClass { }
How do I use IDataErrorInfo members in the derived class to carryout validation of the properties in the derived class??