Initial implementation of history table using TreeDataGrid
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
@@ -55,5 +55,51 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems
}
public bool IsSimilar(HistoryItemViewModelBase item) => Id == item.Id;
+
+ public static Comparison<HistoryItemViewModelBase?> SortAscending<T>(Func<HistoryItemViewModelBase, T> selector)
+ {
+ return (x, y) =>
+ {
+ if (x is null && y is null)
+ {
+ return 0;
+ }
+ else if (x is null)
+ {
+ return -1;
+ }
+ else if (y is null)
+ {
+ return 1;
+ }
+ else
+ {
+ return Comparer<T>.Default.Compare(selector(x), selector(y));
+ }
+ };
+ }
+
+ public static Comparison<HistoryItemViewModelBase?> SortDescending<T>(Func<HistoryItemViewModelBase, T> selector)
+ {
+ return (x, y) =>
+ {
+ if (x is null && y is null)
+ {
+ return 0;
+ }
+ else if (x is null)
+ {
+ return 1;
+ }
+ else if (y is null)
+ {
+ return -1;
+ }
+ else
+ {
+ return Comparer<T>.Default.Compare(selector(y), selector(x));
+ }
+ };
+ }
}
}

ADD
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTablePro.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:c="using:WalletWasabi.Fluent.Controls"
+ xmlns:history="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.History"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:DataType="history:HistoryViewModel"
+ x:CompileBindings="True"
+ ClipToBounds="False"
+ x:Class="WalletWasabi.Fluent.Views.Wallets.Home.History.HistoryTablePro">
+ <Panel>
+
+ <TreeDataGrid Source="{Binding Source}" />
+
+ <Panel IsVisible="{Binding IsTransactionHistoryEmpty}">
+ <c:HistoryPlaceholderPanel Margin="{StaticResource HistoryTablePlaceholderPanelMargin}"
+ RowHeight="{StaticResource HistoryTableRowHeight}"/>
+ <Panel Background="{DynamicResource RegionColor}" Opacity="0.4" />
+
+ <TextBlock Classes="h5 bold"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ Opacity="{StaticResource HistoryTablePlaceholderTextOpacity}">Nothing to see here yet.</TextBlock>
+
+ </Panel>
+ </Panel>
+</UserControl>
\ No newline at end of file

ADD
WalletWasabi.Fluent/Views/Wallets/Home/History/HistoryTablePro.axaml.cs
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Fluent.Views.Wallets.Home.History
+{
+ public class HistoryTablePro : UserControl
+ {
+ public HistoryTablePro()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
<home:WalletTiles />
</Panel>
<Panel>
- <history:HistoryTable Name="HistoryTable"
+ <history:HistoryTablePro Name="HistoryTable"
DataContext="{Binding History}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Panel>

Initial implementation of history table using TreeDataGrid