ApplicationCommands WPF文化问题 [英] ApplicationCommands WPF Culture Problem

查看:45
本文介绍了ApplicationCommands WPF文化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在WPF中遇到ApplicationCommands问题。



当我说话时命令保存到menuitem,menú显示Ctrl + G(西班牙语快捷方式),但是我无法使用此键执行命令,只有当我按下Ctrl + S时才会抛出保存事件。



 <   MenuItem     x:名称  = < span class =code-keyword> MenuArchivo_Save   标题  =  Guardar documento   命令  =  ApplicationCommands.Save  /  >  





有什么方法可以解决这个问题吗?我知道我可以解决它,如果我帮助另一个键绑定,但我想做这个dinamically

解决方案

覆盖标题并使用动态资源/文化文件。



示例:contextMenu.Items.Add(new MenuItem {Header = MetaData.GetString(Save),Command = ApplicationCommands.Save,InputGesture =Ctrl + G}) ;

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.

<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

解决方案

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"});


这篇关于ApplicationCommands WPF文化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆