When using class-level-validation via INotifyDataErrorInfo
every entry is shown twice
#4201
Labels
Investigate
Requires further investigation by the WPF team.
Milestone
INotifyDataErrorInfo
every entry is shown twice
#4201
Problem description:
If you bind to a class which implements
INotifyDataErrorInfo
it runs validation for the whole class. It should show the issue for each property once, but shows it twice.Actual behavior:
Every issue is shown twice like shown in the following image:
Investigating this further showed that the method
GetErrors(string propertyName)
gets calles twice. One time fornull
and one time forstring.Empty
. According to the docs both calls will return the same result: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifydataerrorinfo.geterrors?view=net-5.0I also discussed this here as I first thought it was a bug there: CommunityToolkit/WindowsCommunityToolkit#3763
Expected behavior:
Every issue is shown only once.
Minimal repro:
https:/timunie/MvvmToolkitValidationSample
Thank you and happy coding
Tim
The text was updated successfully, but these errors were encountered: