add separate copy button for each transaction ID
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/CoinJoinDetailsViewModel.cs
using System;
+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.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History.HistoryItems;
@@ -17,6 +21,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
[AutoNotify] private string _status = "";
[AutoNotify] private Money? _coinJoinFee;
[AutoNotify] private string _transactionIdString = "";
+ [AutoNotify] private ObservableCollection<uint256>? _transactionIds;
public CoinJoinDetailsViewModel(CoinJoinsHistoryItemViewModel coinJoinGroup)
{
@@ -25,9 +30,19 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
NextCommand = CancelCommand;
+ CopyCommand = ReactiveCommand.CreateFromTask<object>(async obj =>
+ {
+ if (obj.ToString() is { } text)
+ {
+ await Application.Current.Clipboard.SetTextAsync(text);
+ }
+ });
+
Update();
}
+ public ICommand CopyCommand { get; }
+
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);
@@ -44,9 +59,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
Date = _coinJoinGroup.DateString;
Status = _coinJoinGroup.IsConfirmed ? "Confirmed" : "Pending";
CoinJoinFee = _coinJoinGroup.OutgoingAmount;
-
- var transactionIds = _coinJoinGroup.CoinJoinTransactions.Select(x => x.TransactionId);
- TransactionIdString = string.Join('\n', transactionIds);
+ TransactionIds = new ObservableCollection<uint256>(_coinJoinGroup.CoinJoinTransactions.Select(x => x.TransactionId));
}
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="history:CoinJoinDetailsViewModel"
x:CompileBindings="True"
- x:Class="WalletWasabi.Fluent.Views.Wallets.Home.History.CoinJoinDetailsView">
+ x:Class="WalletWasabi.Fluent.Views.Wallets.Home.History.CoinJoinDetailsView"
+ Name="CoinJoinDetails">
<c:ContentArea Title="{Binding Title}"
NextContent="Done" EnableNext="True"
EnableCancel="{Binding EnableCancel}">
<c:PreviewItem Icon="{StaticResource transaction_id}"
Text="Transaction ID"
CopyParameter="{Binding TransactionIdString}">
+ <ItemsRepeater Items="{Binding TransactionIds}">
+ <ItemsRepeater.ItemTemplate>
+ <DataTemplate>
+ <c:AdorningContentControl ClipToBounds="False" HorizontalAlignment="Left">
+ <c:AdorningContentControl.Adornment>
+ <c:AnimatedButton ToolTip.Tip="Copy"
+ x:CompileBindings="False"
+ Command="{Binding #CoinJoinDetails.DataContext.CopyCommand}"
+ CommandParameter="{Binding .}"
+ NormalIcon="{StaticResource copy_regular}"
+ ClickIcon="{StaticResource copy_confirmed}"
+ InitialOpacity="0.6"
+ HorizontalAlignment="Right"
+ Margin="0 0 -30 0" />
+ </c:AdorningContentControl.Adornment>
+
<c:PrivacyContentControl NumberOfPrivacyChars="48">
- <TextBox Classes="selectableTextBlock monoSpaced" Text="{Binding TransactionIdString}" />
+ <TextBox Classes="selectableTextBlock monoSpaced" Text="{Binding .}" />
</c:PrivacyContentControl>
+
+ </c:AdorningContentControl>
+ </DataTemplate>
+ </ItemsRepeater.ItemTemplate>
+ <ItemsRepeater.Layout>
+ <StackLayout />
+ </ItemsRepeater.Layout>
+ </ItemsRepeater>
</c:PreviewItem>
<Separator />

add separate copy button for each transaction ID