Add a new converter to convert ErrorSeverity into a SolidColorBrush.
MODIFY
WalletWasabi.Gui/Converters/ErrorDescriptorsJsonConverter.cs
WalletWasabi.Gui/Converters/ErrorDescriptorsJsonConverter.cs
@@ -15,9 +15,19 @@ namespace WalletWasabi.Gui.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (value is IEnumerable<Exception> jsonStr)
+ if (value is null) return ErrorDescriptors.Empty;
+
+ if (value is IEnumerable<Exception> exList)
+ {
+ var errors = new ErrorDescriptors();
+
+ foreach (var exMsg in exList.Select(p => p.Message)
+ .Where(p => p != null))
{
- return JsonConvert.DeserializeObject<ErrorDescriptors>(jsonStr.First().Message);
+ errors.AddRange(JsonConvert.DeserializeObject<ErrorDescriptors>(exMsg));
+ }
+
+ return errors;
}
return ErrorDescriptors.Empty;

ADD
WalletWasabi.Gui/Converters/ErrorSeverityColorConverter.cs
+using Avalonia.Data.Converters;
+using Avalonia.Media;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using WalletWasabi.Models;
+
+namespace WalletWasabi.Gui.Converters
+{
+ public class ErrorSeverityColorConverter : IValueConverter
+ {
+ static Dictionary<ErrorSeverity, SolidColorBrush> ErrorSeverityColors = new Dictionary<ErrorSeverity, SolidColorBrush>
+ {
+ { ErrorSeverity.Default, new SolidColorBrush(Colors.White)} ,
+ { ErrorSeverity.Info, new SolidColorBrush(Colors.LightCyan)} ,
+ { ErrorSeverity.Warning, new SolidColorBrush(Colors.Gold)} ,
+ { ErrorSeverity.Error, new SolidColorBrush(Colors.IndianRed)} ,
+ };
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is ErrorSeverity severity)
+ {
+ if (ErrorSeverityColors.TryGetValue(severity, out var brush))
+ {
+ return brush;
+ }
+ }
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}

MODIFY
WalletWasabi.Gui/Styles/Styles.xaml
WalletWasabi.Gui/Styles/Styles.xaml
</x:Arguments>
</FontFamily>
<converters:ErrorDescriptorsJsonConverter x:Key="ErrorDescriptorsJsonConverter" />
+ <converters:ErrorSeverityColorConverter x:Key="ErrorSeverityColorConverter" />
</Style.Resources>
</Style>
<Style Selector="shell|MetroWindow /template/ Button#minimiseButton">
</Setter>
<Setter Property="ErrorTemplate">
<DataTemplate>
- <Grid>
- <Grid.Styles>
- <Style>
- <Setter Property="TextBlock.Foreground" Value="{DynamicResource ErrorBrush}" />
- </Style>
- </Grid.Styles>
- <ItemsControl Items="{Binding}" MemberSelector="Message" />
- </Grid>
+ <ItemsControl Items="{Binding}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Message}" Foreground="{Binding Severity, Converter={StaticResource ErrorSeverityColorConverter}}"/>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
</DataTemplate>
</Setter>
</Style>

Add a new converter to convert ErrorSeverity into a SolidColorBrush.