Added fix for closing wox on pressing escape and app execution (#75)

This commit is contained in:
Divyansh Srivastava
2020-04-08 11:32:59 -07:00
committed by GitHub
parent 0648ecf2d2
commit 9d1b8fbd3e
2 changed files with 339 additions and 332 deletions

View File

@@ -28,4 +28,7 @@
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
d:DataContext="{d:DesignInstance vm:MainViewModel}"> d:DataContext="{d:DesignInstance vm:MainViewModel}">
<xaml:WindowsXamlHost InitialTypeName="PowerLauncher.UI.LauncherControl" ChildChanged="WindowsXamlHost_ChildChanged" /> <xaml:WindowsXamlHost InitialTypeName="PowerLauncher.UI.LauncherControl" ChildChanged="WindowsXamlHost_ChildChanged" />
<Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}"></KeyBinding>
</Window.InputBindings>
</Window> </Window>

View File

@@ -287,7 +287,11 @@ namespace PowerLauncher
if (args != null && args.ChosenSuggestion != null) if (args != null && args.ChosenSuggestion != null)
{ {
ResultViewModel result = (ResultViewModel)args.ChosenSuggestion; ResultViewModel result = (ResultViewModel)args.ChosenSuggestion;
_ = result.Result.Action != null && result.Result.Action(new ActionContext { }); if (result != null)
{
_viewModel.Results.SelectedItem = result;
_viewModel.OpenResultCommand.Execute(null);
}
} }
} }