When using ApplicationCommands class I get a lot of things for free. Text, shortcut and localisation. However there seems to be (or I haven't found it) a way to specify the Character you would specifiy by the _ notation (e.g. E_xit). Is there a way to specify that character for instance for the
ApplicationCommands.New ?
Or is the only solution to this using a
CustomRountedUICommand
where I can simply specify _New for the name property?
EDIT:
To clarify here an extraction of my xaml file:
<MenuItem Name="NewProject" Command="{Binding MenuNewProject}" />
MenuNewProject is an ApplicationCommand.New with an InputGesture added. But how to add the underscore without setting the menu header (which is already done by the command binding)?
Edit2:
As it has been pointed out this is obviously a Menu issue. Now the question is: Is there an alternative to the _ in the text to specify the accelerator key? I haven't found anything in the MenuItem class.
Final solution:
Either use:
AccessKeyManager.Register('N',MenuItem)
but loose the shown underlined N or set
MenuItem.Header ='_New'
manually and loose the localization. Unfortunately parsing ApplicationCommands.New.Name always gives back the English name. There might be a solution with the ContentPresenter class but that is a little bit overshot for my small project.