use notifications for errors when configuring a PIN.
MODIFY
WalletWasabi.Gui/Tabs/SettingsView.xaml
WalletWasabi.Gui/Tabs/SettingsView.xaml
<Button DockPanel.Dock="Left" Content="{Binding IsPinSet, Converter={StaticResource BooleanStringConverter}, ConverterParameter=Clear:Set}" Margin="0 0 10 0" Command="{Binding SetClearPinCommand}" />
<controls:TogglePasswordBox Watermark="PIN" Text="{Binding PinBoxText}" />
</DockPanel>
- <TextBlock Text="{Binding PinWarningMessage}" Classes="warningMessage" Margin="0 0 3 0" />
</StackPanel>
</StackPanel>
</controls:GroupBox>

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -13,6 +13,7 @@ using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Text.RegularExpressions;
+using WalletWasabi.Gui.Helpers;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Gui.ViewModels.Validation;
using WalletWasabi.Helpers;
@@ -39,7 +40,6 @@ namespace WalletWasabi.Gui.Tabs
private string _strongPrivacyLevel;
private string _dustThreshold;
private string _pinBoxText;
- private string _pinWarningMessage;
private ObservableAsPropertyHelper<bool> _isPinSet;
@@ -100,19 +100,19 @@ namespace WalletWasabi.Gui.Tabs
var pinBoxText = PinBoxText?.Trim();
if (string.IsNullOrWhiteSpace(pinBoxText))
{
- PinWarningMessage = "Please provide PIN.";
+ NotificationHelpers.Error("Please provide a PIN");
return;
}
if (pinBoxText.Length > 10)
{
- PinWarningMessage = "PIN too long.";
+ NotificationHelpers.Error("PIN is too long.");
return;
}
if (pinBoxText.Any(x => !char.IsDigit(x)))
{
- PinWarningMessage = "Invalid PIN.";
+ NotificationHelpers.Error("Invalid PIN.");
return;
}
@@ -123,7 +123,7 @@ namespace WalletWasabi.Gui.Tabs
{
if (uiConfigPinHash != enteredPinHash)
{
- PinWarningMessage = "Wrong PIN.";
+ NotificationHelpers.Error("PIN is incorrect!");
PinBoxText = string.Empty;
return;
}
@@ -136,7 +136,6 @@ namespace WalletWasabi.Gui.Tabs
}
PinBoxText = string.Empty;
- PinWarningMessage = string.Empty;
});
TextBoxLostFocusCommand = ReactiveCommand.Create(Save);
@@ -304,12 +303,6 @@ namespace WalletWasabi.Gui.Tabs
set => this.RaiseAndSetIfChanged(ref _pinBoxText, value);
}
- public string PinWarningMessage
- {
- get => _pinWarningMessage;
- set => this.RaiseAndSetIfChanged(ref _pinWarningMessage, value);
- }
-
private void Save()
{
var network = Network;

use notifications for errors when configuring a PIN.