WPF Commands firing via Keyboard shortcuts don't set the Command Parameter

Posted by Aran Mulholland on Stack Overflow See other posts from Stack Overflow or by Aran Mulholland
Published on 2010-03-22T00:17:23Z Indexed on 2010/03/22 0:21 UTC
Read the original article Hit count: 949

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.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about commandbinding