Browse Source
Merge pull request #4704 from KieranDevvs/control-validation-message-fix
Control data validation fix
repro/bound-listboxes
Steven Kirk
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
4 deletions
-
src/Avalonia.Base/Data/Core/Plugins/DataAnnotationsValidationPlugin.cs
-
tests/Avalonia.Base.UnitTests/Data/Core/Plugins/DataAnnotationsValidationPluginTests.cs
|
|
|
@ -63,12 +63,12 @@ namespace Avalonia.Data.Core.Plugins |
|
|
|
{ |
|
|
|
if (errors.Count == 1) |
|
|
|
{ |
|
|
|
return new ValidationException(errors[0].ErrorMessage); |
|
|
|
return new DataValidationException(errors[0].ErrorMessage); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return new AggregateException( |
|
|
|
errors.Select(x => new ValidationException(x.ErrorMessage))); |
|
|
|
errors.Select(x => new DataValidationException(x.ErrorMessage))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -59,12 +59,12 @@ namespace Avalonia.Markup.UnitTests.Data.Plugins |
|
|
|
{ |
|
|
|
new BindingNotification(5), |
|
|
|
new BindingNotification( |
|
|
|
new ValidationException(errmsg), |
|
|
|
new DataValidationException(errmsg), |
|
|
|
BindingErrorType.DataValidationError, |
|
|
|
3), |
|
|
|
new BindingNotification(7), |
|
|
|
new BindingNotification( |
|
|
|
new ValidationException(errmsg), |
|
|
|
new DataValidationException(errmsg), |
|
|
|
BindingErrorType.DataValidationError, |
|
|
|
11), |
|
|
|
}, result); |
|
|
|
|