views:

29

answers:

1

I have Window with UserControl. I subscribed for OnKeyUp event but it does not firing. Inside UserControl constructor i use method this.Focus(); But still onkeyup does not firing. What is wrong and what i can to do to catch this event?

+1  A: 

This is the silverlight scenario , I cannot say it will work in wpf!

keyUp event gets fired of the usercontrol and it works great , here is the code snippet how to register the event handler for KeyUp of usercontrol :

 this.KeyUp += new KeyEventHandler(MainPage_KeyUp);


        void MainPage_KeyUp(object sender, KeyEventArgs e)
        {

        }
Malcolm
Strange but Window or MainPage KeyUp is firing but in usercontrol it is always not active. I will create method in child controls and will pass clicked key to them. Hope this will help. Thanks for reply.
Evgeny