Add label to tx history
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml
<Grid Classes="content">
<DockPanel LastChildFill="True">
<DockPanel LastChildFill="True" DockPanel.Dock="Bottom">
- <Grid ColumnDefinitions="40, 160, 150, *" Margin="10 0 0 0" DockPanel.Dock="Top">
+ <Grid ColumnDefinitions="40, 160, 150, 540, *" Margin="10 0 0 0" DockPanel.Dock="Top">
<TextBlock Text="" />
<controls:SortingArrow Grid.Column="1" Command="{Binding SortCommand}" Text="Date" SortDirection="{Binding DateSortDirection}" />
<controls:SortingArrow Grid.Column="2" Command="{Binding SortCommand}" Text="Amount (BTC)" SortDirection="{Binding AmountSortDirection}" />
<controls:SortingArrow Grid.Column="3" Command="{Binding SortCommand}" Text="Transaction ID" SortDirection="{Binding TransactionSortDirection}" />
+ <controls:SortingArrow Grid.Column="4" Command="{Binding SortCommand}" Text="Label" SortDirection="{Binding LabelSortDirection}" />
</Grid>
<controls:ExtendedListBox Items="{Binding Transactions}" SelectedItem="{Binding SelectedTransaction, Mode=TwoWay}">
<controls:ExtendedListBox.ItemTemplate>
<DataTemplate>
- <Grid ColumnDefinitions="40, 160, 150, *" Background="Transparent">
+ <Grid ColumnDefinitions="40, 160, 150, 540, *" Background="Transparent">
<i:Interaction.Behaviors>
<behaviors:CommandOnDoubleClickBehavior Command="{Binding OpenTransactionInfo}" />
</i:Interaction.Behaviors>
<TextBlock Classes="monospaceFont" Text="{Binding DateTime, ConverterParameter=11, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Grid.Column="1" />
<TextBlock Classes="monospaceFont" Text="{Binding AmountBtc, ConverterParameter=8, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Grid.Column="2" Foreground="{Binding AmountBtc, Converter={StaticResource MoneyBrushConverter}}" />
<TextBlock Classes="monospaceFont" IsVisible="{Binding !ClipboardNotificationVisible}" Text="{Binding TransactionId, ConverterParameter=50, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Grid.Column="3" />
+ <TextBlock Classes="monospaceFont" Text="{Binding Label, ConverterParameter=11, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Grid.Column="4" />
<Grid IsVisible="{Binding ClipboardNotificationVisible}" Grid.Column="3">
<Grid Opacity="{Binding ClipboardNotificationOpacity}">
<Grid.Transitions>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -25,6 +25,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private SortOrder _dateSortDirection;
private SortOrder _amountSortDirection;
private SortOrder _transactionSortDirection;
+ private SortOrder _labelSortDirection;
public HistoryTabViewModel(Wallet wallet)
: base("History")
@@ -57,6 +58,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => SortColumn(x, nameof(TransactionSortDirection)));
+ this.WhenAnyValue(x => x.LabelSortDirection)
+ .Where(x => x != SortOrder.None)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x => SortColumn(x, nameof(LabelSortDirection)));
+
SortCommand.ThrownExceptions
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex =>
@@ -104,6 +110,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _transactionSortDirection, value);
}
+ public SortOrder LabelSortDirection
+ {
+ get => _labelSortDirection;
+ set => this.RaiseAndSetIfChanged(ref _labelSortDirection, value);
+ }
+
public override void OnOpen(CompositeDisposable disposables)
{
base.OnOpen(disposables);
@@ -171,7 +183,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (savedCol != nameof(DateSortDirection)
& savedCol != nameof(AmountSortDirection)
- & savedCol != nameof(TransactionSortDirection))
+ & savedCol != nameof(TransactionSortDirection)
+ & savedCol != nameof(LabelSortDirection))
{
Global.UiConfig.HistoryTabViewSortingPreference = new SortingPreference(SortOrder.Decreasing, nameof(DateSortDirection));
}
@@ -189,11 +202,25 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
DateSortDirection = sortPref.Match(sortOrder, nameof(DateSortDirection));
AmountSortDirection = sortPref.Match(sortOrder, nameof(AmountSortDirection));
TransactionSortDirection = sortPref.Match(sortOrder, nameof(TransactionSortDirection));
+ LabelSortDirection = sortPref.Match(sortOrder, nameof(LabelSortDirection));
}
private void RefreshOrdering()
{
- if (TransactionSortDirection != SortOrder.None)
+ if (LabelSortDirection != SortOrder.None)
+ {
+ switch (LabelSortDirection)
+ {
+ case SortOrder.Increasing:
+ Transactions = new ObservableCollection<TransactionViewModel>(_transactions.OrderBy(t => t.Label));
+ break;
+
+ case SortOrder.Decreasing:
+ Transactions = new ObservableCollection<TransactionViewModel>(_transactions.OrderByDescending(t => t.Label));
+ break;
+ }
+ }
+ else if (TransactionSortDirection != SortOrder.None)
{
switch (TransactionSortDirection)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewModel.cs
@@ -99,6 +99,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
this.RaisePropertyChanged(nameof(AmountBtc));
this.RaisePropertyChanged(nameof(TransactionId));
this.RaisePropertyChanged(nameof(DateTime));
+ this.RaisePropertyChanged(nameof(Label));
}
public async Task TryCopyTxIdToClipboardAsync()

Add label to tx history