diff --git a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs index 72f110c5d0..bc2802c403 100644 --- a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs +++ b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs @@ -260,26 +260,26 @@ namespace PowerLauncher _launcher = (PowerLauncher.UI.LauncherControl)host.Child; _launcher.DataContext = _viewModel; _launcher.SearchBox.TextChanged += QueryTextBox_TextChanged; - //_launcher.SearchBox.SuggestionChosen += SearchBox_SuggestionChosen; - //_launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic); + _launcher.SearchBox.SuggestionChosen += SearchBox_SuggestionChosen; + _launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic); - //_viewModel.PropertyChanged += (o, e) => - //{ - // if (e.PropertyName == nameof(MainViewModel.MainWindowVisibility)) - // { - // if (Visibility == System.Windows.Visibility.Visible) - // { - // Activate(); - // _launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic); - // UpdatePosition(); - // _settings.ActivateTimes++; - // if (!_viewModel.LastQuerySelected) - // { - // _viewModel.LastQuerySelected = true; - // } - // } - // } - //}; + _viewModel.PropertyChanged += (o, e) => + { + if (e.PropertyName == nameof(MainViewModel.MainWindowVisibility)) + { + if (Visibility == System.Windows.Visibility.Visible) + { + Activate(); + _launcher.SearchBox.Focus(Windows.UI.Xaml.FocusState.Programmatic); + UpdatePosition(); + _settings.ActivateTimes++; + if (!_viewModel.LastQuerySelected) + { + _viewModel.LastQuerySelected = true; + } + } + } + }; } private void SearchBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) @@ -287,15 +287,8 @@ namespace PowerLauncher if (args != null) { ResultViewModel result = (ResultViewModel)args.SelectedItem; - bool hideWindow = result.Result.Action != null && result.Result.Action(new ActionContext - { - - }); - if (!hideWindow) - { - Console.WriteLine("here"); - } - } + _ = result.Result.Action != null && result.Result.Action(new ActionContext{}); + } } private void QueryTextBox_TextChanged(Windows.UI.Xaml.Controls.AutoSuggestBox sender, Windows.UI.Xaml.Controls.AutoSuggestBoxTextChangedEventArgs args)