Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all,

I have a problem with ApplicationCommands in WPF.

When i assing a command "save" to a menuitem, the menú show me Ctrl+G (spanish shortcut), but i can't execute the command using this keys, only when i push Ctrl+S throw the "Save" event.

HTML
<MenuItem x:Name="MenuArchivo_Save" Header="Guardar documento" Command="ApplicationCommands.Save"/>


Exists any way to solve this problem? i know that i can solve it if i assing another keybinding, but i want do this dinamically
Posted
Updated 29-Mar-17 9:55am

1 solution

Overwrite the Header and use Dynamic Resources / Culture Files.

Example: contextMenu.Items.Add(new MenuItem { Header = MetaData.GetString("Save"), Command = ApplicationCommands.Save, InputGesture = "Ctrl+G"});
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900