diff --git a/src/Perspex.Input/KeyBinding.cs b/src/Perspex.Input/KeyBinding.cs index 108690e6ef..0757922932 100644 --- a/src/Perspex.Input/KeyBinding.cs +++ b/src/Perspex.Input/KeyBinding.cs @@ -18,6 +18,15 @@ namespace Perspex.Input set { SetValue(CommandProperty, value); } } + public static readonly StyledProperty CommandParameterProperty = + PerspexProperty.Register("CommandParameter"); + + public object CommandParameter + { + get { return GetValue(CommandParameterProperty); } + set { SetValue(CommandParameterProperty, value); } + } + public static readonly StyledProperty GestureProperty = PerspexProperty.Register("Gesture"); @@ -32,8 +41,8 @@ namespace Perspex.Input if (Gesture?.Matches(args) == true) { args.Handled = true; - if (Command?.CanExecute(null) == true) - Command.Execute(null); + if (Command?.CanExecute(CommandParameter) == true) + Command.Execute(CommandParameter); } } }