I'm trying to use a UserControl in Silverlight and I want to handle some key events. The user control is a network diagram, laying out data points in a circle and showing the relations between points. It consists of a canvas to which various shapes (ellipses
for data points, lines for relations between points). I'd like it to be focusable and receive mouse and keyboard events to add support for things like rotation, scaling, and randomizing the layout of data points (how readable the diagram is depends on the
data and where in the circle related data points are located, but I'm not going to attempt any smart layout logic that figures out where to put the points; instead, I simply allow the points to be laid out in random order along the circle); I was thinking
F5 (with it's "reload/refresh" connotations) would be a neat key for this.
Trouble is, I am never ever receiving any key events. Mouse events apparently do bubble up to the canvas, but only from labels - the data points have labels - so I can handle them there. Currently this allows me to resize and rotate the diagram by scrolling
the mouse wheel (with the shift key down to rotate, without to scale) if and only if the mouse cursor is over a label. Not *quite* what I want!
After some quick googling I've attempted to set IsTabStop to true on the UserControl containing the Canva
View Complete Post