public bool Validate(string propertyName, IRuleSet ruleSet)
{
if (ruleSet == null)
{
Errors[propertyName] = new List<IActionableErrorInfo>();
}
else
{
List<IActionableErrorInfo> errorsTos = ruleSet.ValidateRules();
List<IActionableErrorInfo> actionableErrorInfos =
errorsTos.ConvertAll<IActionableErrorInfo>(input => new ActionableErrorInfo(input, () =>
{
//
}));
Errors[propertyName] = actionableErrorInfos;
}
OnPropertyChanged("Errors");
List<IActionableErrorInfo> errorList;
if (Errors.TryGetValue(propertyName, out errorList))
{
return errorList.Count == 0;
}
return false;
}