开发者

Is there a global focus change event in Silverlight?

开发者 https://www.devze.com 2023-02-16 15:46 出处:网络
Is there a global focus change event? I would like to be notified every time FocusManag开发者_开发技巧er.GetFocusedElement changes.You can attach GotFocus and LostFocus event handlers on the root visu

Is there a global focus change event? I would like to be notified every time FocusManag开发者_开发技巧er.GetFocusedElement changes.


You can attach GotFocus and LostFocus event handlers on the root visual of your application (a page). Since these events are routed events they will bubble up the elements tree to the root every time focus changes inside your page.


I don't recall seeing such a feature. In theory you could use the VisualTreeHelper to traverse the GUI and attach to Focus events of your controls.

0

精彩评论

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