Fix IndentToBrushConverter
MODIFY
WalletWasabi.Fluent/Converters/IndentToColorConverter.cs
WalletWasabi.Fluent/Converters/IndentToColorConverter.cs
using System.Collections.Generic;
using System.Globalization;
-using System.Linq;
+using Avalonia;
using Avalonia.Controls.Models.TreeDataGrid;
using Avalonia.Data;
using Avalonia.Data.Converters;
@@ -8,22 +8,25 @@ using Avalonia.Media;
namespace WalletWasabi.Fluent.Converters;
-internal class IndentToColorConverter : IMultiValueConverter
+internal class IndentToBrushConverter : IMultiValueConverter
{
- public static IndentToColorConverter Instance { get; } = new();
-
public List<IBrush>? Brushes { get; set; }
public object Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
{
- var obj = values.Skip(0).First();
+ if (values.Count != 2)
+ {
+ return AvaloniaProperty.UnsetValue;
+ }
+
+ var model = values[0];
- if (obj is null || values.Skip(1).First() is not IRows rows)
+ if (values[1] is not IRows rows)
{
- return BindingOperations.DoNothing;
+ return AvaloniaProperty.UnsetValue;
}
- var rowIndex = FindIndex(rows, el => el.Model == obj);
+ var rowIndex = FindIndex(rows, el => el.Model == model);
var modelIndex = rows.RowIndexToModelIndex(rowIndex);
return GetBrush(modelIndex.Count - 1) ?? BindingOperations.DoNothing;
}

MODIFY
WalletWasabi.Fluent/Views/CoinControl/SelectCoinsDialogView.axaml
WalletWasabi.Fluent/Views/CoinControl/SelectCoinsDialogView.axaml
<Setter Property="Height" Value="37.5" />
</Style>
- <!--<Style Selector="TreeDataGridCellsPresenter">
- <Style.Resources>
- <converters:IndentToColorConverter x:Key="IndentToBrushConverter">
- <converters:IndentToColorConverter.Brushes>
- <generic:List x:TypeArguments="IBrush">
- <SolidColorBrush>Transparent</SolidColorBrush>
- <SolidColorBrush Color="{DynamicResource SystemListLowColor}" />
- </generic:List>
- </converters:IndentToColorConverter.Brushes>
- </converters:IndentToColorConverter>
- </Style.Resources>
- <Setter Property="Background">
- <Setter.Value>
- <MultiBinding Converter="{StaticResource IndentToBrushConverter}">
- <Binding Path="." />
- <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=TreeDataGridCellsPresenter}" Path="Rows" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style>-->
-
<Style Selector="TreeDataGridRow /template/ Rectangle">
<Style.Resources>
- <converters:IndentToColorConverter x:Key="IndentToBrushConverter">
- <converters:IndentToColorConverter.Brushes>
+ <converters:IndentToBrushConverter x:Key="IndentToBrushConverter">
+ <converters:IndentToBrushConverter.Brushes>
<generic:List x:TypeArguments="IBrush">
<SolidColorBrush>Transparent</SolidColorBrush>
<SolidColorBrush Color="{DynamicResource SystemListLowColor}" />
</generic:List>
- </converters:IndentToColorConverter.Brushes>
- </converters:IndentToColorConverter>
+ </converters:IndentToBrushConverter.Brushes>
+ </converters:IndentToBrushConverter>
</Style.Resources>
<Setter Property="Fill">
<Setter.Value>

Fix IndentToBrushConverter