views:

352

answers:

1

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 that calls a parent's event directly). I'd just like to get a global keydown event. Is this is a possibility in Silverlight 3?

A: 

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.

AnthonyWJones