What's the best way to handle the same shortcut in WPF and WinForms controls?
- by Anthony Brien
I have a WPF application with the following KeyBinding on its main window:
<KeyBinding Command="Commands:EditCommands.Undo" Gesture="CTRL+Z" />
<KeyBinding Command="Commands:EditCommands.Redo" Gesture="CTRL+Y" />
This makes the command respond to the shortcut fine. However, in all the places where I have embedded WinForms text boxes or rich text boxes, I've lost the ability to use those shortcuts. If I remove the above bindings, the WinForms shortcuts work fine.
How can I support these shortcuts in both WinForms and WPF? I'd prefer a generic method since this problem is likely to affect many other commands with the same keybindings.