I have implemented a WPF ApplicationsCommand.New and thought it would be a clever idea to implement alternative scenarios with the same command - just using different parameters from an enumeration for doing different things.
<MenuItem Header="{x:Static cmdLabel:Strings.STR_CmdName_New_Text}" Command="New" CommandParameter="{x:Static vm:TypeOfDocument.EdiTextEditor}" ToolTip="{x:Static cmdLabel:Strings.STR_CmdName_New_Text_TT}" ToolTipService.ShowOnDisabled="True" /><MenuItem Header="{x:Static cmdLabel:Strings.STR_CmdName_New_UML}" Command="New" CommandParameter="{x:Static vm:TypeOfDocument.UMLEditor}" ToolTip="{x:Static cmdLabel:Strings.STR_CmdName_New_UML_TT}" ToolTipService.ShowOnDisabled="True" />
see h t t p s : / /edi.codeplex.com/SourceControl/latest#Edi/View/MainMenu.xaml
My Command definition is the standard that WPF has predefined. I simply bind the implementation to ApplicationsCommand.New without changing any gestures. The result is that I have two menu entries and both are listed with CTRL+N.
In my case, I want to create a new:
- text document with CTRL+N or
- a new UML document with CTRL+N,U
Is there a way to resolve this with ApplicationsCommand.New?
What about RoutedUICommands? Is it possible to recycle the same RoutedUICommand in multiple places, using different parameters and different keyboard shortcuts?
Thanks for any help on this as I was unable to resolve this on my own :-(