I am trying to read the value like this <KeyBinding Key="{x:Static prop:Resources.F6}"
it gives me an error Invalid type. It works when it is <KeyBinding Key="F6"
Any ideas or reason for this is appreciated
As MSDN states, the KeyBinding.Key
property is of the enum type Key
. WPF will convert the string "F6" to Key.F6. Unless your Resources.F6
property also returns a Key
enumeration, this will not work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.