Add Label required notification
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
<Button Content="Generate Receive Address" Command="{Binding GenerateCommand}" VerticalAlignment="Top" Grid.Column="1" />
</Grid>
+ <Grid IsVisible="{Binding LabelRequiredNotificationVisible}">
+ <Grid Opacity="{Binding LabelRequiredNotificationOpacity}">
+ <Grid.Transitions>
+ <Transitions>
+ <DoubleTransition Property="Grid.Opacity"
+ Easing="CircularEaseIn"
+ Duration="0:0:0.5" />
+ </Transitions>
+ </Grid.Transitions>
+ <TextBlock Classes="warningMessage" Text="Label Is Required!" VerticalAlignment="Center" HorizontalAlignment="Center" />
+ </Grid>
+ </Grid>
<Grid IsVisible="{Binding ClipboardNotificationVisible}">
<Grid Opacity="{Binding ClipboardNotificationOpacity}">
<Grid.Transitions>
Duration="0:0:0.5" />
</Transitions>
</Grid.Transitions>
- <TextBlock Text="Address Copied to Clipboard!" Foreground="#22B14C" VerticalAlignment="Center" HorizontalAlignment="Center" />
+ <TextBlock Text="Address Is Copied To Clipboard!" Foreground="#22B14C" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Grid>
</Grid>
</DockPanel>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -18,6 +18,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private ObservableCollection<AddressViewModel> _addresses;
private AddressViewModel _selectedAddress;
private string _label;
+ private double _labelRequiredNotificationOpacity;
+ private bool _labelRequiredNotificationVisible;
private double _clipboardNotificationOpacity;
private bool _clipboardNotificationVisible;
@@ -37,6 +39,20 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
GenerateCommand = ReactiveCommand.Create(() =>
{
+ if (string.IsNullOrWhiteSpace(Label))
+ {
+ LabelRequiredNotificationVisible = true;
+ LabelRequiredNotificationOpacity = 1;
+
+ Dispatcher.UIThread.Post(async () =>
+ {
+ await Task.Delay(1000);
+ LabelRequiredNotificationOpacity = 0;
+ });
+
+ return;
+ }
+
HdPubKey newKey = Global.WalletService.GetReceiveKey(Label);
AddressViewModel found = Addresses.FirstOrDefault(x => x.Model == newKey);
@@ -52,7 +68,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
SelectedAddress = newAddress;
Label = string.Empty;
- }, this.WhenAnyValue(x => x.Label, label => !string.IsNullOrWhiteSpace(label)));
+ });
this.WhenAnyValue(x => x.SelectedAddress).Subscribe(async address =>
{
@@ -101,6 +117,18 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set { this.RaiseAndSetIfChanged(ref _label, value); }
}
+ public double LabelRequiredNotificationOpacity
+ {
+ get { return _labelRequiredNotificationOpacity; }
+ set { this.RaiseAndSetIfChanged(ref _labelRequiredNotificationOpacity, value); }
+ }
+
+ public bool LabelRequiredNotificationVisible
+ {
+ get { return _labelRequiredNotificationVisible; }
+ set { this.RaiseAndSetIfChanged(ref _labelRequiredNotificationVisible, value); }
+ }
+
public double ClipboardNotificationOpacity
{
get { return _clipboardNotificationOpacity; }

Add Label required notification