Toggle Receive Address Expander.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
</controls:ExtendedListBox.Styles>
<controls:ExtendedListBox.ContextMenu>
<ContextMenu>
- <MenuItem Header="Show QR code" Command="{Binding ShowQrCode}">
+ <MenuItem Header="{Binding SelectedAddress.ExpandMenuCaption}" Command="{Binding ToggleQrCode}">
<MenuItem.Icon>
<Path HorizontalAlignment="Left" Data="M16.803,18.615h-4.535c-1,0-1.814-0.812-1.814-1.812v-4.535c0-1.002,0.814-1.814,1.814-1.814h4.535c1.001,0,1.813,0.812,1.813,1.814v4.535C18.616,17.803,17.804,18.615,16.803,18.615zM17.71,12.268c0-0.502-0.405-0.906-0.907-0.906h-4.535c-0.501,0-0.906,0.404-0.906,0.906v4.535c0,0.502,0.405,0.906,0.906,0.906h4.535c0.502,0,0.907-0.404,0.907-0.906V12.268z M16.803,9.546h-4.535c-1,0-1.814-0.812-1.814-1.814V3.198c0-1.002,0.814-1.814,1.814-1.814h4.535c1.001,0,1.813,0.812,1.813,1.814v4.534C18.616,8.734,17.804,9.546,16.803,9.546zM17.71,3.198c0-0.501-0.405-0.907-0.907-0.907h-4.535c-0.501,0-0.906,0.406-0.906,0.907v4.534c0,0.501,0.405,0.908,0.906,0.908h4.535c0.502,0,0.907-0.406,0.907-0.908V3.198z M7.733,18.615H3.198c-1.002,0-1.814-0.812-1.814-1.812v-4.535c0-1.002,0.812-1.814,1.814-1.814h4.535c1.002,0,1.814,0.812,1.814,1.814v4.535C9.547,17.803,8.735,18.615,7.733,18.615zM8.64,12.268c0-0.502-0.406-0.906-0.907-0.906H3.198c-0.501,0-0.907,0.404-0.907,0.906v4.535c0,0.502,0.406,0.906,0.907,0.906h4.535c0.501,0,0.907-0.404,0.907-0.906V12.268z M7.733,9.546H3.198c-1.002,0-1.814-0.812-1.814-1.814V3.198c0-1.002,0.812-1.814,1.814-1.814h4.535c1.002,0,1.814,0.812,1.814,1.814v4.534C9.547,8.734,8.735,9.546,7.733,9.546z M8.64,3.198c0-0.501-0.406-0.907-0.907-0.907H3.198c-0.501,0-0.907,0.406-0.907,0.907v4.534c0,0.501,0.406,0.908,0.907,0.908h4.535c0.501,0,0.907-0.406,0.907-0.908V3.198z" Fill="#22B14C" Height="16" Width="16" Stretch="Fill" />
</MenuItem.Icon>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -31,7 +31,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public ReactiveCommand<Unit, Unit> CopyAddress { get; }
public ReactiveCommand<Unit, Unit> CopyLabel { get; }
- public ReactiveCommand<Unit, Unit> ShowQrCode { get; }
+ public ReactiveCommand<Unit, Unit> ToggleQrCode { get; }
public ReactiveCommand<Unit, Unit> ChangeLabelCommand { get; }
public ReceiveTabViewModel(WalletViewModel walletViewModel)
@@ -114,11 +114,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{ }
}, isCoinListItemSelected);
- ShowQrCode = ReactiveCommand.Create(() =>
+ ToggleQrCode = ReactiveCommand.Create(() =>
{
try
{
- SelectedAddress.IsExpanded = true;
+ SelectedAddress.IsExpanded = !(SelectedAddress.IsExpanded);
}
catch (Exception)
{ }

MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -25,6 +25,7 @@ namespace WalletWasabi.Gui.ViewModels
private double _clipboardNotificationOpacity;
private string _label;
private bool _inEditMode;
+ private ObservableAsPropertyHelper<string> _expandMenuCaption;
public HdPubKey Model { get; }
public Global Global { get; }
@@ -76,6 +77,10 @@ namespace WalletWasabi.Gui.ViewModels
}
}
});
+
+ _expandMenuCaption = this.WhenAnyValue(x => x.IsExpanded)
+ .Select(x => (x ? "Hide " : "Show ") + "QR Code")
+ .ToProperty(this, x => x.ExpandMenuCaption);
}
public bool IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
@@ -128,6 +133,8 @@ namespace WalletWasabi.Gui.ViewModels
set => this.RaiseAndSetIfChanged(ref _qrCode, value);
}
+ public string ExpandMenuCaption => _expandMenuCaption?.Value ?? string.Empty;
+
public CancellationTokenSource CancelClipboardNotification { get; set; }
public async Task TryCopyToClipboardAsync()

Toggle Receive Address Expander.