hide address logic
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
@@ -4,6 +4,8 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Threading.Tasks;
+using Avalonia;
using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.Keys;
@@ -66,7 +68,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
foreach (HdPubKey key in keys)
{
- Addresses.Add(new AddressViewModel(key, Network));
+ Addresses.Add(new AddressViewModel(key, Network, HideAddress));
}
}
catch (Exception ex)
@@ -74,5 +76,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
Logger.LogError(ex);
}
}
+
+ private async Task HideAddress(HdPubKey model, string address)
+ {
+ model.SetKeyState(KeyState.Locked, Wallet.KeyManager);
+ InitializeAddresses();
+
+ var isAddressCopied = await Application.Current.Clipboard.GetTextAsync() == address;
+ if (isAddressCopied)
+ {
+ await Application.Current.Clipboard.ClearAsync();
+ }
+ }
}
}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
<DataGridTemplateColumn Header="Reference"
Width="*"
CanUserSort="True"
- x:CompileBindings="False"
SortMemberPath="Label">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
- <DockPanel LastChildFill="True" Margin="10 0">
+ <DockPanel LastChildFill="True" Margin="10 0" x:DataType="receive:AddressViewModel">
<Button Classes="plain addressActionButton">
<PathIcon Data="{StaticResource wallet_action_coinjoin}" Classes="addressActionIcon" />
</Button>
<DataGridTemplateColumn Header="Address"
Width="2*"
CanUserSort="True"
- x:CompileBindings="False"
SortMemberPath="Address">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
- <DockPanel LastChildFill="True" Margin="10 0">
- <Button Classes="plain addressActionButton">
+ <DockPanel LastChildFill="True" Margin="10 0" x:DataType="receive:AddressViewModel">
+ <Button Classes="plain addressActionButton" Command="{Binding HideAddressCommand}">
<PathIcon Data="{StaticResource dismiss_light}" Classes=" addressActionIcon"/>
</Button>
<Button Classes="plain addressActionButton" Command="{Binding CopyAddressCommand}">

hide address logic