Set focus on text box control on hotkey invoke (#1859)

This commit is contained in:
Betsegaw (Beta) Tadele 2020-04-02 10:24:44 -07:00 committed by GitHub
parent 96fbc968ef
commit 5c01e0e852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -21,7 +21,8 @@
TextElement.FontSize="14"
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
Deactivated="Window_Deactivated"
ShowInTaskbar="false">
ShowInTaskbar="false"
GotFocus="Window_GotFocus">
<Window.Resources>
<ResourceDictionary>

View file

@ -114,5 +114,10 @@ namespace WindowWalker
viewModel.WindowHideCommand.Execute(null);
}
}
private void Window_GotFocus(object sender, RoutedEventArgs e)
{
this.searchBox.Focus();
}
}
}