Replace detecting traling \n with behavior.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -91,26 +91,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
await Global.Config.ToFileAsync();
});
- this.WhenAnyValue(x => x.Password).Subscribe(async x =>
- {
- try
- {
- if (x.NotNullAndNotEmpty())
- {
- char lastChar = x.Last();
- if (lastChar == '\r' || lastChar == '\n') // If the last character is cr or lf then act like it'd be a sign to do the job.
- {
- Password = x.TrimEnd('\r', '\n');
- await DoEnqueueAsync(CoinsList.Coins.Where(c => c.IsSelected));
- }
- }
- }
- catch (Exception ex)
- {
- Logger.LogTrace(ex);
- }
- });
-
this.WhenAnyValue(x => x.IsEnqueueBusy)
.Select(x => x ? EnqueuingButtonTextString : EnqueueButtonTextString)
.Subscribe(text => EnqueueButtonText = text);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
@@ -30,25 +30,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
ClearSensitiveData(true);
SetWarningMessage("");
- this.WhenAnyValue(x => x.Password).Subscribe(x =>
- {
- try
- {
- if (x.NotNullAndNotEmpty())
- {
- char lastChar = x.Last();
- if (lastChar == '\r' || lastChar == '\n') // If the last character is cr or lf then act like it'd be a sign to do the job.
- {
- Password = x.TrimEnd('\r', '\n');
- }
- }
- }
- catch (Exception ex)
- {
- Logging.Logger.LogTrace(ex);
- }
- });
-
ToggleSensitiveKeysCommand = ReactiveCommand.Create(() =>
{
try

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletView.xaml
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletView.xaml
<StackPanel>
<TextBlock Text="Select a wallet to test its password!" FontWeight="Bold" />
</StackPanel>
- <controls:TogglePasswordBox Text="{Binding Password}" />
+ <controls:TogglePasswordBox Text="{Binding Password}">
+ <i:Interaction.Behaviors>
+ <behaviors:CommandOnEnterBehavior Command="{Binding LoadCommand}" />
+ </i:Interaction.Behaviors>
+ </controls:TogglePasswordBox>
<StackPanel>
<TextBlock Text="Why the unconventional password masking?" FontWeight="Bold" />
<TextBlock Text="We received numerous reports on losing or mistyping passwords. This experiment aims to disrupt users' typical workflow at wallet generation, forcing them to pay more attention than otherwise would." TextWrapping="Wrap" />

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -78,26 +78,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
this.WhenAnyValue(x => x.IsBusy)
.Subscribe(_ => TrySetWalletStates());
- this.WhenAnyValue(x => x.Password).Subscribe(async x =>
- {
- try
- {
- if (x.NotNullAndNotEmpty())
- {
- char lastChar = x.Last();
- if (lastChar == '\r' || lastChar == '\n') // If the last character is cr or lf then act like it'd be a sign to do the job.
- {
- Password = x.TrimEnd('\r', '\n');
- await LoadKeyManagerAsync(requirePassword: true, isHardwareWallet: false);
- }
- }
- }
- catch (Exception ex)
- {
- Logger.LogTrace(ex);
- }
- });
-
LoadCommand = ReactiveCommand.CreateFromTask(async () => await LoadWalletAsync(), this.WhenAnyValue(x => x.CanLoadWallet));
TestPasswordCommand = ReactiveCommand.CreateFromTask(async () => await LoadKeyManagerAsync(requirePassword: true, isHardwareWallet: false), this.WhenAnyValue(x => x.CanTestPassword));
OpenFolderCommand = ReactiveCommand.Create(OpenWalletsFolder);

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletView.xaml
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletView.xaml
<TextBlock Text="At recovery, the wallet is unable to check if your password is correct or not. If you provide the wrong password, a wallet will be recovered with the provided Recovery Words and password combination." TextWrapping="Wrap" />
</StackPanel>
<controls:ExtendedTextBox Text="{Binding WalletName}" Watermark="Wallet Name" UseFloatingWatermark="True" />
- <controls:TogglePasswordBox Text="{Binding Password}" />
+ <controls:TogglePasswordBox Text="{Binding Password}">
+ <i:Interaction.Behaviors>
+ <behaviors:CommandOnEnterBehavior Command="{Binding RecoverCommand}" />
+ </i:Interaction.Behaviors>
+ </controls:TogglePasswordBox>
<controls:ExtendedTextBox Text="{Binding MnemonicWords}" Watermark="Recovery Words" UseFloatingWatermark="True" CaretIndex="{Binding CaretIndex}">
<i:Interaction.Behaviors>
<behaviors:SuggestionBehavior SuggestionItems="{Binding Suggestions}" />

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -88,24 +88,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
});
this.WhenAnyValue(x => x.MnemonicWords).Subscribe(UpdateSuggestions);
- this.WhenAnyValue(x => x.Password).Subscribe(x =>
- {
- try
- {
- if (x.NotNullAndNotEmpty())
- {
- char lastChar = x.Last();
- if (lastChar == '\r' || lastChar == '\n') // If the last character is cr or lf then act like it'd be a sign to do the job.
- {
- Password = x.TrimEnd('\r', '\n');
- }
- }
- }
- catch (Exception ex)
- {
- Logger.LogTrace(ex);
- }
- });
_suggestions = new ObservableCollection<SuggestionViewModel>();
}

Replace detecting traling \n with behavior.