|
|
|
@ -495,11 +495,17 @@ namespace Avalonia.Controls |
|
|
|
else |
|
|
|
{ |
|
|
|
classes.Add(":error"); |
|
|
|
DataValidationErrors = new[] { status.Error }; |
|
|
|
DataValidationErrors = UnpackException(status.Error); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static IEnumerable<Exception> UnpackException(Exception exception) |
|
|
|
{ |
|
|
|
var aggregate = exception as AggregateException; |
|
|
|
return aggregate == null ? Enumerable.Repeat(exception, 1) : aggregate.InnerExceptions; |
|
|
|
} |
|
|
|
|
|
|
|
private int CoerceCaretIndex(int value) |
|
|
|
{ |
|
|
|
var text = Text; |
|
|
|
|