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.
精彩评论