c# - Applicationcommands Name in Menu Header -
when using applicationcommands class lot of things free. text, shortcut , localisation. there seems (or haven't found it) way specify character specifiy _ notation (e.g. e_xit). there way specify character instance the
applicationcommands.new ? or solution using
customrounteduicommand where can specify _new name property?
edit:
to clarify here extraction of xaml file:
<menuitem name="newproject" command="{binding menunewproject}" /> menunewproject applicationcommand.new inputgesture added. how add underscore without setting menu header (which done command binding)?
edit2:
as has been pointed out menu issue. question is: there alternative _ in text specify accelerator key? haven't found in menuitem class.
final solution:
either use:
accesskeymanager.register('n',menuitem) but loose shown underlined n or set
menuitem.header ='_new' manually , loose localization. unfortunately parsing applicationcommands.new.name gives english name. there might solution contentpresenter class little bit overshot small project.
use underscore _ in header text create hotkey or use inputbinding create shortcut (from answer):
<window.commandbindings> <commandbinding command="new" executed="commandbinding_executed" /> </window.commandbindings> <window.inputbindings> <keybinding key="n" modifiers="control" command="new"/> </window.inputbindings>
Comments
Post a Comment