Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试读取这样的值,<KeyBinding Key="{x:Static prop:Resources.F6}" 它给了我一个错误无效类型。它在它的时候工作<KeyBinding Key="F6"
<KeyBinding Key="{x:Static prop:Resources.F6}"
<KeyBinding Key="F6"
对此的任何想法或理由表示赞赏
正如MSDN所述,该KeyBinding.Key属性是 enum 类型的Key。WPF 会将字符串“F6”转换为 Key.F6。除非您的Resources.F6属性也返回一个Key枚举,否则这将不起作用。
KeyBinding.Key
Key
Resources.F6