>WPF and shortcuts

>

Forcing the user to sprout a third arm to use a mouse is considered bad programming.

All menus should have shortcuts.  To be frank almost all controls should have shortcuts.  To use a few seconds to add shortcuts to the controls as they are made is considered good.

Shortcuts in WPF is done by prefixing with underscore, like E_xit and _Open. (WinForm is done by prefixing with ampersand, like E&xit.  Web applications should have this too and there it is called Accesskey.

Then to add the nice “Ctrl-O” text beside Open and “Ctrl-S” beside Save is trickier in WPF.  By no special order these are the pages I had to read to understand CommandBinding and RoutedUICommand:
http://anuraj.wordpress.com/2008/06/23/shortcuts-keys-in-wpf-menu/
http://en.csharp-online.net/WPF_Concepts—Built-In_Commands
http://colbycavin.spaces.live.com/blog/cns!5FFDF795EBC7BEDF!129.entry

Leave a Reply