Triggering Silverlight Prism command with a keyboard shortcut

前端 未结 2 1707
面向向阳花
面向向阳花 2021-01-14 08:57

Does anybody know whether one can trigger prism command with a shortcut? What I mean is I want to be able to define binding of a command to keyboard shortcut in declarative

2条回答
  •  生来不讨喜
    2021-01-14 09:44

    You could write an attached behavior that has a listens to the KeyUp event and then calls the Command. The complication comes in translating something like Gesture="Ctrl+Shift+A". You would need to write a parser to figure out exactly what key combination that string represents.

提交回复
热议问题