开发者

How To Get Global MouseMove And KeyDown Events In Silverlight

Application.Current.RootVisual.KeyDown += Application_KeyDown

The above does not work if I'm on a ChildWindow - that was instantiated in runtime. My question is, how do I get the mousemove or keydown event in the Parent Window that hosts this ChildWindow?

Also, I'd rather not change anything in the childwindow (i.e., add an event t开发者_运维知识库hat calls a parent's event directly). I'd just like to get a global keydown event. Is this is a possibility in Silverlight 3?


There isn't a Global Keydown event. You will need to assign the Application_KeyDown to the ChildWindow's KeyDown event when you call the Show method and remove it when the Closed event fires.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜