The Invalid interface callback of ValidationAttribute is too lagging. #20833
Unanswered
Jason-Git123
asked this question in
Q&A
Replies: 2 comments
-
|
Personally I prefer to use the communityToolkit.MVVM package. It has a method to invalidate the validation for specific properties or all properties. https://docs.avaloniaui.net/docs/guides/development-guides/data-validation |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Btw: 32 is a valid value in your sample |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
The validation of TextBox-Text is achieved through the custom ValidationAttribute attribute marked by the bound Model attribute, but the IsValid interface of the ValidationAttribute is only called after the attribute has been updated
eg:
int m_addressLength = 32;
[Range(1, 32)]
public int AddressLength
{
get {return m_addressLength;}
set
{
m_addressLength = value;
RaisePropertyChanged(nameof(AddressLength))
}
}
To Reproduce
Is there a way to callback the ValidationAttribute-IsValid check before updating the mode property.
Expected behavior
No response
Avalonia version
e.g. 11.3.3
OS
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions