Skip to content

Commit

Permalink
Set focus on text box control on hotkey invoke (#1859)
Browse files Browse the repository at this point in the history
  • Loading branch information
betsegaw committed Apr 2, 2020
1 parent 96fbc96 commit 5c01e0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/windowwalker/app/Window Walker/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 5 additions & 0 deletions src/modules/windowwalker/app/Window Walker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,10 @@ private void HideWindow()
viewModel.WindowHideCommand.Execute(null);
}
}

private void Window_GotFocus(object sender, RoutedEventArgs e)
{
this.searchBox.Focus();
}
}
}

0 comments on commit 5c01e0e

Please sign in to comment.