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
parent
commit
a10fdcf186
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/Avalonia.Input/KeyBinding.cs

6
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);
}
}
}
}

Loading…
Cancel
Save