Finding a Silverlight 3 or 4 Control That Provides Decent Keyboard Support

I have an N-Tier application using Silverlight for a client. The client as one specific request - I thought it was more than reasonable: all actions, including navigation through the menu, should be accessible from the keyboard.
When I tried Silverlight 4, I was surprised I didn't find any menu control, so I downloaded a few open source and commercial menu controls. I was very disappointed, after checking for a couple of hours, I was unable to find any control that provides decent keyboard support. Most controls do not have support or some basic support, but more than one control can increase keyboard focus on the first control .You can use the keyboard (arrow keys), but first you need to select control with your mouse! More than one control provided support for keyboard shortcuts.

Does anyone know of any Silverlight control that provides descent support?

+2


source to share


2 answers


Personally, I'm glad the inline menu control isn't included. I'm not suggesting that your application really needs it, but at least it makes you think about it, if you could deliver functionality without what you have, and that's a good thing.

It looks like you are looking for menu access keys, eg <Alt>+F

. Now here's what, in order to work well, the API would need to support the keypreview event on the page, allowing you to intercept the desired key combination even though the control has focus.

Silverlight does not provide such an event. The best you can do is KeyDown or KeyUp event on UserControl

. You can make it a tab so that it can receive focus even if there is no other control in the user interface.



However, any control that marks the KeyDown or KeyUp event as handled will prevent UserControl

this event from being received and thus the menu response to such direct keyboard access will be patchy and inconsistent. This, in turn, will be interpreted as a bug by most users.

For this reason, I suspect menu control vendors do not offer this feature, lest their reputation be harmed by what is actually a platform limitation.

The bottom line is that if you must have this feature, you could probably handle it well enough with KeyUp or KeyDown event handling, but you need to test the UI thoroughly to make sure there are any circumstances. under which it does not work.

+2


source


This menu provides a pretty decent solution:

http://sl4popupmenu.codeplex.com/



Due to browser limitations, the selection of keyboard modifiers is mostly limited to Ctrl + Alt though.

0


source







All Articles