behavior for hiding columns
ADD
WalletWasabi.Fluent/Behaviors/HideDataGridColumnBehavior.cs
+using System;
+using System.Linq;
+using System.Reactive.Disposables;
+using Avalonia;
+using Avalonia.Controls;
+using ReactiveUI;
+
+namespace WalletWasabi.Fluent.Behaviors
+{
+ public class HideDataGridColumnBehavior : DisposingBehavior<DataGrid>
+ {
+ public static readonly StyledProperty<double> HideThresholdWidthProperty =
+ AvaloniaProperty.Register<HideDataGridColumnBehavior, double>(nameof(HideThresholdWidth));
+
+ public static readonly StyledProperty<string> ColumnHeaderProperty =
+ AvaloniaProperty.Register<HideDataGridColumnBehavior, string>(nameof(ColumnHeader));
+
+ public double HideThresholdWidth
+ {
+ get => GetValue(HideThresholdWidthProperty);
+ set => SetValue(HideThresholdWidthProperty, value);
+ }
+
+ public string ColumnHeader
+ {
+ get => GetValue(ColumnHeaderProperty);
+ set => SetValue(ColumnHeaderProperty, value);
+ }
+
+ protected override void OnAttached(CompositeDisposable disposables)
+ {
+ AssociatedObject?
+ .WhenAnyValue(x => x.Bounds.Width)
+ .Subscribe(width =>
+ {
+ var firstOrDefault = AssociatedObject.Columns.FirstOrDefault(x => ReferenceEquals(x.Header, ColumnHeader));
+
+ if (firstOrDefault is { } column)
+ {
+ column.IsVisible = width > HideThresholdWidth;
+ }
+ });
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTable.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:history="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.History"
xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
+ xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
+ xmlns:i="using:Avalonia.Xaml.Interactivity"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="history:HistoryViewModel"
x:CompileBindings="True"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
CanUserResizeColumns="False"
DockPanel.Dock="Bottom">
+ <i:Interaction.Behaviors>
+ <behaviors:HideDataGridColumnBehavior HideThresholdWidth="900" ColumnHeader="Type"/>
+ </i:Interaction.Behaviors>
<DataGrid.Styles>
<Style Selector="PathIcon">
<Setter Property="Width" Value="15"/>

behavior for hiding columns