0
如何驗證這個班?(WPF)如何驗證這個班?(WPF)
我無法理解的是物業值每個。
對於這種方法:公共覆蓋的ValidationResult驗證(對象值
名最大字符必須是10; 年齡最大的值必須是150;
public class Person : ValidationRule
{
string _Name;
public string Name
{
get
{
return _Name;
}
set
{
_Name = value;
}
}
int _age = 20;
public int Age
{
get { return _age; }
set { _age = value; }
}
string _Phone = "000-0000";
public string Phone
{
get { return _Phone; }
set { _Phone = value; }
}
public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
{
**//is value Which Property?**
//I can not understand is the Property Value for each
return new ValidationResult(true, null);
}
}