Enter password, key listen, focus changes
MODIFY
WalletWasabi.Fluent/AddWallet/Common/EnterPasswordView.axaml
WalletWasabi.Fluent/AddWallet/Common/EnterPasswordView.axaml
x:Class="WalletWasabi.Fluent.AddWallet.Common.EnterPasswordView"
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors;assembly=WalletWasabi.Fluent"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity">
+ <UserControl.KeyBindings>
+ <KeyBinding Gesture="Enter" Command="{Binding ContinueCommand}" />
+ </UserControl.KeyBindings>
<DockPanel>
<DockPanel DockPanel.Dock="Bottom">
<Button DockPanel.Dock="Left" Content="Cancel" Command="{Binding CancelCommand}" Classes="invisible"
HorizontalAlignment="Left" VerticalAlignment="Bottom" />
<Button DockPanel.Dock="Right" Content="Continue" Command="{Binding ContinueCommand}" Classes="action"
- HorizontalAlignment="Right" VerticalAlignment="Bottom">
- <i:Interaction.Behaviors>
- <behaviors:FocusOnEnableBehavior />
- </i:Interaction.Behaviors>
- </Button>
+ HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
</DockPanel>
<c:ContentArea Title="Enter a password"
<DockPanel>
<PathIcon Classes="checkMark" Margin="15 42 0 0" VerticalAlignment="Top" DockPanel.Dock="Right">
<i:Interaction.Behaviors>
- <behaviors:CheckMarkVisibilityBehavior OwnerTextBox="{Binding #TbPassword}" IsFocused="{Binding #TbPassword.IsFocused}" Text="{Binding #TbPassword.Text}" />
+ <behaviors:CheckMarkVisibilityBehavior OwnerTextBox="{Binding #TbPassword}" Text="{Binding #TbPassword.Text}" />
</i:Interaction.Behaviors>
</PathIcon>
<Label Content="_Type a password:" Target="TbPassword" DockPanel.Dock="Top"/>
<DockPanel>
<PathIcon Classes="checkMark" Margin="15 42 0 0" VerticalAlignment="Top" DockPanel.Dock="Right">
<i:Interaction.Behaviors>
- <behaviors:CheckMarkVisibilityBehavior OwnerTextBox="{Binding #TbConfirmPassword}" IsFocused="{Binding #TbConfirmPassword.IsFocused}" Text="{Binding #TbConfirmPassword.Text}" />
+ <behaviors:CheckMarkVisibilityBehavior OwnerTextBox="{Binding #TbConfirmPassword}" Text="{Binding #TbConfirmPassword.Text}" />
</i:Interaction.Behaviors>
</PathIcon>
<Label Content="_Type a password:" Target="TbConfirmPassword" DockPanel.Dock="Top"/>

MODIFY
WalletWasabi.Fluent/AddWallet/Common/EnterPasswordViewModel.cs
WalletWasabi.Fluent/AddWallet/Common/EnterPasswordViewModel.cs
@@ -68,7 +68,7 @@ namespace WalletWasabi.Fluent.AddWallet.Common
private void ValidateConfirmPassword(IValidationErrors errors)
{
- if (!string.IsNullOrEmpty(Password) && !string.IsNullOrEmpty(ConfirmPassword) && Password != ConfirmPassword)
+ if (!string.IsNullOrEmpty(ConfirmPassword) && Password != ConfirmPassword)
{
errors.Add(ErrorSeverity.Error, PasswordHelper.MatchingMessage);
}

MODIFY
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsView.axaml
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsView.axaml
<UserControl.Resources>
<converters:BoolToOpacityConverter x:Key="BoolToOpacityConverter" />
</UserControl.Resources>
+ <UserControl.KeyBindings>
+ <KeyBinding Gesture="Enter" Command="{Binding FinishCommand}" />
+ </UserControl.KeyBindings>
<Panel>
<c:ContentArea Title="Confirm recovery words" Caption="Type the required recovery words">

MODIFY
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
@@ -52,6 +52,7 @@ namespace WalletWasabi.Fluent.Behaviors
x => x.Text)
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
+ .Where(_ => AssociatedObject is { })
.Subscribe(_ => AssociatedObject!.Opacity = !HasErrors && !IsFocused && !string.IsNullOrEmpty(Text) ? 1 : 0);
Observable

Enter password, key listen, focus changes