Skip to content

Commit 58fbb16

Browse files
committed
code_review: PR #644
- use `AutoFocusBehaviour.IsEnable` instead of toggle focus by code in `OnOpened ` Signed-off-by: leo <[email protected]>
1 parent 794163f commit 58fbb16

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/Views/Askpass.axaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
<TextBlock Text="{Binding Description}" TextWrapping="Wrap"/>
4040
</Border>
4141

42-
<TextBox Name="PassphraseTextBox"
43-
Margin="16"
42+
<TextBox Margin="16"
4443
MinWidth="300"
4544
Height="32"
4645
Focusable="True"
4746
Text="{Binding Passphrase, Mode=TwoWay}"
4847
PasswordChar="*"
4948
RevealPassword="{Binding ShowPassword, Mode=OneWay}"
50-
HorizontalAlignment="Stretch">
49+
HorizontalAlignment="Stretch"
50+
v:AutoFocusBehaviour.IsEnabled="True">
5151
<TextBox.InnerRightContent>
5252
<ToggleButton Grid.Column="6"
5353
Classes="toggle_untracked"

src/Views/Askpass.axaml.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,5 @@ private void EnterPassword(object _1, RoutedEventArgs _2)
5252
Console.Out.Write($"{Passphrase}\n");
5353
App.Quit(0);
5454
}
55-
56-
protected override void OnOpened(EventArgs e)
57-
{
58-
PassphraseTextBox.Focus();
59-
base.OnOpened(e);
60-
}
6155
}
6256
}

0 commit comments

Comments
 (0)