Put ChangeLabel to AddressViewModel
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource ReceiveTabView_CopyIcon}" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Change Label" Command="{Binding ChangeLabelCommand}">
+ <MenuItem Header="Change Label" Command="{Binding ChangeLabel}">
<MenuItem.Icon>
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource ReceiveTabView_ChangeLabel}" />
</MenuItem.Icon>

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> ChangeLabelCommand { get; }
public ReactiveCommand<Unit, Unit> DisplayAddressOnHwCommand { get; }
public ReactiveCommand<Unit, Unit> GenerateCommand { get; }
@@ -80,17 +79,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
await address.TryCopyToClipboardAsync();
});
- ChangeLabelCommand = ReactiveCommand.Create(() =>
- {
- var selectedAddress = SelectedAddress;
- if (selectedAddress is null)
- {
- return;
- }
-
- SelectedAddress.InEditMode = true;
- });
-
DisplayAddressOnHwCommand = ReactiveCommand.CreateFromTask(async () =>
{
var selectedAddress = SelectedAddress;
@@ -114,7 +102,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Observable
.Merge(DisplayAddressOnHwCommand.ThrownExceptions)
- .Merge(ChangeLabelCommand.ThrownExceptions)
.Merge(GenerateCommand.ThrownExceptions)
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex =>

MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -30,6 +30,7 @@ namespace WalletWasabi.Gui.ViewModels
public ReactiveCommand<Unit, Unit> SaveQRCode { get; }
public ReactiveCommand<Unit, Unit> CopyAddress { get; }
public ReactiveCommand<Unit, Unit> CopyLabel { get; }
+ public ReactiveCommand<Unit, bool> ChangeLabel { get; }
public HdPubKey Model { get; }
public Global Global { get; }
@@ -96,11 +97,14 @@ namespace WalletWasabi.Gui.ViewModels
CopyLabel = ReactiveCommand.CreateFromTask(async () => await Application.Current.Clipboard.SetTextAsync(Label ?? string.Empty));
+ ChangeLabel = ReactiveCommand.Create(() => InEditMode = true);
+
Observable
.Merge(ToggleQrCode.ThrownExceptions)
.Merge(SaveQRCode.ThrownExceptions)
.Merge(CopyAddress.ThrownExceptions)
.Merge(CopyLabel.ThrownExceptions)
+ .Merge(ChangeLabel.ThrownExceptions)
.Subscribe(ex =>
{
NotificationHelpers.Error(ex.ToTypeMessageString());

Put ChangeLabel to AddressViewModel