开发者

Global application hook for mouse events in Silverlight

开发者 https://www.devze.com 2022-12-31 01:24 出处:网络
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开发者_开

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消