hc:TextBox support for Validation
This commit is contained in:
1 parent
17a54ef7ea
commit
fcf3f9b72f
2 files changed
+18
-3
No files matched your search
@@ -112,9 +112,22 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user