Global application hook for mouse events in Silverlight
Is there any way to register a global event handler for catching mouse events in a Silverlight application? I'd like to avoid subscribing to the mouse event handlers of each FrameworkElement开发者_开发技巧 and find a more elegant solution (bubbled events). Thanks
MouseMove is a bubbling event in Silverlight; have you tried to catch it at the level of the Window ?
All the Mouse events are bubbling events so on the surface of it you should be able to attach event handlers to a root UserControl
or Page
element and get the events.
However many of the controls have use for the mouse events and handle these events themselves. In those cases those events do not bubble any futher.
精彩评论