hc:DatePicker support for Validation

This commit is contained in:
NaBian committed 2021-07-18 14:25:53 +08:00
1 parent ac8b5561a5
commit 13d9404848
6 files changed
+23 -9

No files matched your search

@@ -153,9 +153,21 @@ namespace HandyControl.Controls
}
}
IsError = !result.Data;
ErrorStr = result.Message;
return result.Data;
var isError = !result.Data;
if (isError)
{
SetCurrentValue(IsErrorProperty, true);
SetCurrentValue(ErrorStrProperty, result.Message);
}
else
{
isError = Validation.GetHasError(this);
if (isError)
{
SetCurrentValue(ErrorStrProperty, Validation.GetErrors(this)[0].ErrorContent);
}
}
return !isError;
}
}
}