Put CopyLabel to AddressViewModel
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -29,7 +29,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private AddressViewModel _selectedAddress;
private SuggestLabelViewModel _labelSuggestion;
- public ReactiveCommand<Unit, Unit> CopyLabel { get; }
public ReactiveCommand<Unit, Unit> ChangeLabelCommand { get; }
public ReactiveCommand<Unit, Unit> DisplayAddressOnHwCommand { get; }
public ReactiveCommand<Unit, Unit> GenerateCommand { get; }
@@ -81,8 +80,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
await address.TryCopyToClipboardAsync();
});
- CopyLabel = ReactiveCommand.CreateFromTask(async () => await Application.Current.Clipboard.SetTextAsync(SelectedAddress?.Label ?? string.Empty));
-
ChangeLabelCommand = ReactiveCommand.Create(() =>
{
var selectedAddress = SelectedAddress;
@@ -118,7 +115,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Observable
.Merge(DisplayAddressOnHwCommand.ThrownExceptions)
.Merge(ChangeLabelCommand.ThrownExceptions)
- .Merge(CopyLabel.ThrownExceptions)
.Merge(GenerateCommand.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex =>

MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -29,6 +29,7 @@ namespace WalletWasabi.Gui.ViewModels
public ReactiveCommand<Unit, bool> ToggleQrCode { get; }
public ReactiveCommand<Unit, Unit> SaveQRCode { get; }
public ReactiveCommand<Unit, Unit> CopyAddress { get; }
+ public ReactiveCommand<Unit, Unit> CopyLabel { get; }
public HdPubKey Model { get; }
public Global Global { get; }
@@ -93,10 +94,13 @@ namespace WalletWasabi.Gui.ViewModels
CopyAddress = ReactiveCommand.CreateFromTask(TryCopyToClipboardAsync);
+ CopyLabel = ReactiveCommand.CreateFromTask(async () => await Application.Current.Clipboard.SetTextAsync(Label ?? string.Empty));
+
Observable
.Merge(ToggleQrCode.ThrownExceptions)
.Merge(SaveQRCode.ThrownExceptions)
.Merge(CopyAddress.ThrownExceptions)
+ .Merge(CopyLabel.ThrownExceptions)
.Subscribe(ex =>
{
NotificationHelpers.Error(ex.ToTypeMessageString());

Put CopyLabel to AddressViewModel