Serialize then Deserialize via Converter the ErrorDescriptor as a workaround. Remove this hack when we update to Avalonia 0.9.
ADD
WalletWasabi.Gui/Converters/ErrorDescriptorsJsonConverter.cs
+using Avalonia;
+using Avalonia.Data.Converters;
+using NBitcoin;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using WalletWasabi.Models;
+
+namespace WalletWasabi.Gui.Converters
+{
+ public class ErrorDescriptorsJsonConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is IEnumerable<Exception> jsonStr)
+ {
+ return JsonConvert.DeserializeObject<ErrorDescriptors>(jsonStr.First().Message);
+ }
+
+ return ErrorDescriptors.Empty;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}

MODIFY
WalletWasabi.Gui/Styles/Styles.xaml
WalletWasabi.Gui/Styles/Styles.xaml
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dock="clr-namespace:Dock.Avalonia.Controls;assembly=Dock.Avalonia"
xmlns:shell="clr-namespace:AvalonStudio.Shell.Controls;assembly=AvalonStudio.Shell"
+ xmlns:converters="clr-namespace:WalletWasabi.Gui.Converters;assembly=WalletWasabi.Gui"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:controls="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui">
<Style>
<x:Uri>resm:WalletWasabi.Gui.Assets.*.ttf?assembly=WalletWasabi.Gui</x:Uri>
</x:Arguments>
</FontFamily>
+ <converters:ErrorDescriptorsJsonConverter x:Key="ErrorDescriptorsJsonConverter" />
</Style.Resources>
</Style>
<Style Selector="shell|MetroWindow /template/ Button#minimiseButton">
DockPanel.Dock="Bottom"
ContentTemplate="{TemplateBinding ErrorTemplate}"
DataContext="{TemplateBinding Owner}"
- Content="{Binding (DataValidationErrors.Errors)}"
+ Content="{Binding (DataValidationErrors.Errors), Converter={StaticResource ErrorDescriptorsJsonConverter}}"
IsVisible="{Binding (DataValidationErrors.HasErrors)}" />
<ContentPresenter
Name="PART_ContentPresenter"

MODIFY
WalletWasabi.Gui/ViewModels/ViewModelBase.cs
WalletWasabi.Gui/ViewModels/ViewModelBase.cs
+using Newtonsoft.Json;
using ReactiveUI;
using System;
using System.Collections;
@@ -30,12 +31,11 @@ namespace WalletWasabi.Gui.ViewModels
{
var error = Validator.ValidateProperty(this, propertyName, ValidationMethodCache);
- if (error.HasErrors)
- {
- return error.Select(p => p.Message);
- }
+ if (!error.HasErrors) return null;
- return ErrorDescriptors.Empty;
+ // HACK: Need to serialize this in order to pass through IndeiValidationPlugin on Avalonia 0.8.2.
+ // Should be removed when Avalonia has the hotfix update.
+ return new List<string>() { JsonConvert.SerializeObject(error) };
}
protected void NotifyErrorsChanged(string propertyName)

Serialize then Deserialize via Converter the ErrorDescriptor as a workaround. Remove this hack when we update to Avalonia 0.9.