Browse Source
Merge pull request #7337 from filestar/keybinding-only-handle-if-handled
Only handle a KeyBinding if it's actually been handled.
pull/7343/head
Max Katz
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
src/Avalonia.Input/KeyBinding.cs
|
|
|
@ -35,9 +35,11 @@ namespace Avalonia.Input |
|
|
|
{ |
|
|
|
if (Gesture?.Matches(args) == true) |
|
|
|
{ |
|
|
|
args.Handled = true; |
|
|
|
if (Command?.CanExecute(CommandParameter) == true) |
|
|
|
if (Command?.CanExecute(CommandParameter) == true) |
|
|
|
{ |
|
|
|
args.Handled = true; |
|
|
|
Command.Execute(CommandParameter); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|