AutoCompleteBox validation broken? #17459
Unanswered
David-A-Blankenship
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Avalonia 11.2.0 running on Windows desktop
Question: Is there something that I am doing wrong here, or is validation broken?
Any help would be appreciated.
I am having issues with data validation using the AutoCompleteBox. The behavior I am seeing is that if the bound value starts out with a validation error, the AutoCompleteBox will display the validation error. As long as the value is in error, the AutoCompleteBox will display the correct validation error. For example, I change between a required validator and a minimum length validator. Once all validation errors are cleared, the AutoCompleteBox will not display any validation errors.
I have reproduced this behavior with the BindingDemo included in the Avalonia source. That demo uses all three types of data validation, Exceptions, INotifyDataErrorInfo and DataAnnotations. I get the above behavior using INotifyDataErrorInfo and DataAnnotations. Using the Exceptions validation plugin, AutoCompleteBox is not displaying any validation errors.
Xaml for the AutoCompleteBox for all validation pluggins:
<AutoCompleteBox Watermark="Auto-complete" Text="{Binding Item}" ItemsSource="{Binding ItemValues}"/>
DataAnnotations view model properties:
INotifyDataErrorInfo view model properties:
Exception view model properties:
With validation errors displayed:
With validation errors missing:
Beta Was this translation helpful? Give feedback.
All reactions