Add single CoinJoin history item details
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinDetailsViewModel.cs
@@ -15,17 +15,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History;
[NavigationMetaData(Title = "Coinjoin Details")]
public partial class CoinJoinDetailsViewModel : RoutableViewModel
{
- private readonly CoinJoinsHistoryItemViewModel _coinJoinGroup;
+ private readonly CoinJoinHistoryItemViewModel _coinJoin;
[AutoNotify] private string _date = "";
[AutoNotify] private string _status = "";
[AutoNotify] private Money? _coinJoinFee;
[AutoNotify] private string _coinJoinFeeString = "";
- [AutoNotify] private ObservableCollection<uint256>? _transactionIds;
+ [AutoNotify] private uint256? _transactionId;
- public CoinJoinDetailsViewModel(CoinJoinsHistoryItemViewModel coinJoinGroup)
+ public CoinJoinDetailsViewModel(CoinJoinHistoryItemViewModel coinJoin)
{
- _coinJoinGroup = coinJoinGroup;
+ _coinJoin = coinJoin;
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
NextCommand = CancelCommand;
@@ -48,7 +48,7 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
base.OnNavigatedTo(isInHistory, disposables);
Observable
- .FromEventPattern(_coinJoinGroup, nameof(PropertyChanged))
+ .FromEventPattern(_coinJoin, nameof(PropertyChanged))
.Throttle(TimeSpan.FromMilliseconds(100))
.Subscribe(_ => Update())
.DisposeWith(disposables);
@@ -56,11 +56,11 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
private void Update()
{
- Date = _coinJoinGroup.DateString;
- Status = _coinJoinGroup.IsConfirmed ? "Confirmed" : "Pending";
- CoinJoinFee = _coinJoinGroup.OutgoingAmount;
+ Date = _coinJoin.DateString;
+ Status = _coinJoin.IsConfirmed ? "Confirmed" : "Pending";
+ CoinJoinFee = _coinJoin.OutgoingAmount;
CoinJoinFeeString = CoinJoinFee.ToFeeDisplayUnitString() ?? "Unknown";
- TransactionIds = new ObservableCollection<uint256>(_coinJoinGroup.CoinJoinTransactions.Select(x => x.TransactionId));
+ TransactionId = _coinJoin.CoinJoinTransaction.TransactionId;
}
}

ADD
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinsDetailsViewModel.cs
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using System.Windows.Input;
+using Avalonia;
+using NBitcoin;
+using ReactiveUI;
+using WalletWasabi.Fluent.Extensions;
+using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
+
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History;
+
+[NavigationMetaData(Title = "Coinjoin Details")]
+public partial class CoinJoinsDetailsViewModel : RoutableViewModel
+{
+ private readonly CoinJoinsHistoryItemViewModel _coinJoinGroup;
+
+ [AutoNotify] private string _date = "";
+ [AutoNotify] private string _status = "";
+ [AutoNotify] private Money? _coinJoinFee;
+ [AutoNotify] private string _coinJoinFeeString = "";
+ [AutoNotify] private ObservableCollection<uint256>? _transactionIds;
+
+ public CoinJoinsDetailsViewModel(CoinJoinsHistoryItemViewModel coinJoinGroup)
+ {
+ _coinJoinGroup = coinJoinGroup;
+
+ SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
+ NextCommand = CancelCommand;
+
+ CopyCommand = ReactiveCommand.CreateFromTask<uint256>(async txid =>
+ {
+ if (Application.Current is { Clipboard: { } clipboard })
+ {
+ await clipboard.SetTextAsync(txid.ToString());
+ }
+ });
+
+ Update();
+ }
+
+ public ICommand CopyCommand { get; }
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ Observable
+ .FromEventPattern(_coinJoinGroup, nameof(PropertyChanged))
+ .Throttle(TimeSpan.FromMilliseconds(100))
+ .Subscribe(_ => Update())
+ .DisposeWith(disposables);
+ }
+
+ private void Update()
+ {
+ Date = _coinJoinGroup.DateString;
+ Status = _coinJoinGroup.IsConfirmed ? "Confirmed" : "Pending";
+ CoinJoinFee = _coinJoinGroup.OutgoingAmount;
+ CoinJoinFeeString = CoinJoinFee.ToFeeDisplayUnitString() ?? "Unknown";
+
+ TransactionIds = new ObservableCollection<uint256>(_coinJoinGroup.CoinJoinTransactions.Select(x => x.TransactionId));
+ }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
@@ -23,6 +23,7 @@ public class CoinJoinHistoryItemViewModel : HistoryItemViewModelBase
Date = transactionSummary.DateTime.ToLocalTime();
Balance = balance;
IsCoinJoin = true;
+ CoinJoinTransaction = transactionSummary;
var amount = transactionSummary.Amount;
if (amount < Money.Zero)
@@ -36,10 +37,13 @@ public class CoinJoinHistoryItemViewModel : HistoryItemViewModelBase
ShowDetailsCommand = ReactiveCommand.Create(() =>
RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(
- new TransactionDetailsViewModel(transactionSummary, walletViewModel.Wallet, updateTrigger)));
+ new CoinJoinDetailsViewModel(this)));
DateString = $"{Date.ToLocalTime():MM/dd/yy HH:mm}";
}
public bool IsCoinJoinTransaction => true;
+
+ public TransactionSummary CoinJoinTransaction { get; private set; }
+
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
@@ -29,7 +29,7 @@ public class CoinJoinsHistoryItemViewModel : HistoryItemViewModelBase
CoinJoinTransactions = new List<TransactionSummary>();
IsCoinJoin = true;
- ShowDetailsCommand = ReactiveCommand.Create(() => RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(new CoinJoinDetailsViewModel(this)));
+ ShowDetailsCommand = ReactiveCommand.Create(() => RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(new CoinJoinsDetailsViewModel(this)));
Add(firstItem);
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
<!-- Transaction IDs -->
<c:PreviewItem Icon="{StaticResource transaction_id}"
Label="Transaction ID">
- <ItemsRepeater Items="{Binding TransactionIds}">
- <ItemsRepeater.ItemTemplate>
- <DataTemplate>
- <c:PreviewItem TextValue="{Binding }">
+ <c:PreviewItem DataContext="{Binding TransactionId}" TextValue="{Binding }">
<c:PrivacyContentControl NumberOfPrivacyChars="48">
<TextBlock Text="{Binding }" Classes="monoSpaced" />
</c:PrivacyContentControl>
</c:PreviewItem>
- </DataTemplate>
- </ItemsRepeater.ItemTemplate>
- </ItemsRepeater>
</c:PreviewItem>
<Separator />

ADD
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinsDetailsView.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:history="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.History"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:DataType="history:CoinJoinsDetailsViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Wallets.Home.History.CoinJoinsDetailsView"
+ Name="CoinJoinDetails">
+ <c:ContentArea Title="{Binding Title}"
+ NextContent="Done" EnableNext="True"
+ EnableCancel="{Binding EnableCancel}">
+ <StackPanel Spacing="15">
+
+ <!-- Date -->
+ <c:PreviewItem Icon="{StaticResource timer_regular}"
+ Label="Date"
+ TextValue="{Binding Date}">
+ <TextBlock Text="{Binding Date}" />
+ </c:PreviewItem>
+
+ <Separator />
+
+ <!-- Transaction IDs -->
+ <c:PreviewItem Icon="{StaticResource transaction_id}"
+ Label="Transaction ID">
+ <ItemsRepeater Items="{Binding TransactionIds}">
+ <ItemsRepeater.ItemTemplate>
+ <DataTemplate>
+ <c:PreviewItem TextValue="{Binding }">
+ <c:PrivacyContentControl NumberOfPrivacyChars="48">
+ <TextBlock Text="{Binding }" Classes="monoSpaced" />
+ </c:PrivacyContentControl>
+ </c:PreviewItem>
+ </DataTemplate>
+ </ItemsRepeater.ItemTemplate>
+ </ItemsRepeater>
+ </c:PreviewItem>
+
+ <Separator />
+
+ <!-- Status -->
+ <c:PreviewItem Icon="{StaticResource status_regular}"
+ Label="Status">
+ <TextBlock Text="{Binding Status}" />
+ </c:PreviewItem>
+
+ <Separator />
+
+ <!-- CJ fee -->
+ <c:PreviewItem Icon="{StaticResource btc_logo}"
+ Label="Fees:"
+ TextValue="{Binding CoinJoinFee}">
+ <TextBlock Text="{Binding CoinJoinFeeString, Mode=OneWay}" />
+ </c:PreviewItem>
+ </StackPanel>
+ </c:ContentArea>
+</UserControl>

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

Add single CoinJoin history item details