So, I am programming an application in WPF / C #, and currently I am using this method of handling quick keystrokes. And I hate him so much.
private void MainWnd_KeyDown(object sender, KeyEventArgs e) if (e.Key == Key.F1 && Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { DoCtrlF1Function(); }
Now, no doubt, I would use command bindings, but in XAML, if I put the name and not the built-in, I get an exception using the WPF editor. Is there a better way to do this (e.g. add my own commands, will it look like RoutedCommand?)
source share