WPF Commands firing via Keyboard shortcuts don't set the Command Parameter
- by Aran Mulholland
I have a command binding on the main form of my application. It is used to open details of the item that i am viewing. It has an associated keyboard shortcut.
When i use the command in sub-forms i pass the object i want to open details for as a CommandParameter. This works if i attach the command to a button or a context menu, as i can specify the command parameter with a binding. However when the command is invoked as a result of a Keyboard shortcut i never get the chance to specify the parameter.
How can i specify the command parameter at the sub-form level for a keyboard fired command. I need the CommandBinding with the CanExecute and Execute specified on the main form to globally handle all the open details events.