Set default focus on password text box (#644)

Co-authored-by: AleksandrLiakhavetsEPAM <97155822+AleksandrLiakhavetsEPAM@users.noreply.github.com>
This commit is contained in:
Aliaksandr Liakhavets 2024-11-03 04:25:32 +03:00 committed by GitHub
parent 1fecbbb37f
commit 794163fe1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -39,9 +39,11 @@
<TextBlock Text="{Binding Description}" TextWrapping="Wrap"/> <TextBlock Text="{Binding Description}" TextWrapping="Wrap"/>
</Border> </Border>
<TextBox Margin="16" <TextBox Name="PassphraseTextBox"
Margin="16"
MinWidth="300" MinWidth="300"
Height="32" Height="32"
Focusable="True"
Text="{Binding Passphrase, Mode=TwoWay}" Text="{Binding Passphrase, Mode=TwoWay}"
PasswordChar="*" PasswordChar="*"
RevealPassword="{Binding ShowPassword, Mode=OneWay}" RevealPassword="{Binding ShowPassword, Mode=OneWay}"

View file

@ -52,5 +52,11 @@ namespace SourceGit.Views
Console.Out.Write($"{Passphrase}\n"); Console.Out.Write($"{Passphrase}\n");
App.Quit(0); App.Quit(0);
} }
protected override void OnOpened(EventArgs e)
{
PassphraseTextBox.Focus();
base.OnOpened(e);
}
} }
} }