hc:TimePicker support for Validation

This commit is contained in:
NaBian committed 2021-07-18 14:44:55 +08:00
1 parent 30ed64e5d2
commit 1d0744b348
2 files changed
+17 -3

No files matched your search

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