From e5529512de4ba590e39dc24ddd10ce0e894efbe6 Mon Sep 17 00:00:00 2001 From: bkardol Date: Tue, 2 Aug 2016 12:18:55 +0200 Subject: [PATCH] Hiding keyboard on pressing return key in password box Hiding keyboard on pressing return key in password box by setting the focus on loginbutton. --- PokemonGo-UWP/Views/MainPage.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PokemonGo-UWP/Views/MainPage.xaml.cs b/PokemonGo-UWP/Views/MainPage.xaml.cs index f9bbd1ba8..960a2f7ff 100644 --- a/PokemonGo-UWP/Views/MainPage.xaml.cs +++ b/PokemonGo-UWP/Views/MainPage.xaml.cs @@ -13,10 +13,10 @@ public MainPage() private void passwordBox_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { - if (e.Key == Windows.System.VirtualKey.Enter && loginButton.Command.CanExecute(null) == true) + if (e.Key == Windows.System.VirtualKey.Enter) { - loginButton.Command.Execute(null); - } + loginButton.Focus(Windows.UI.Xaml.FocusState.Programmatic); + } } } } \ No newline at end of file