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
2 changed files with 7 additions and 1 deletions

View File

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

View File

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