Senkwe
Senkwe

Reputation: 2256

How to determine when the WP7 SIP keyboard has been dismissed

I've noticed that when the SIP keyboard is displayed, the OnBackKeyPress event isn't fired when the user dismisses the keyboard via the WP7 back button.

Is there a way for me to determine when the keyboard has been dismissed via the back button?

Thanks

Upvotes: 0

Views: 783

Answers (2)

Ku6opr
Ku6opr

Reputation: 8126

Check for LostFocus event on TextBox. Maybe it can be suitable for you (but it also will fire when a user tap outside of TextBox)

Upvotes: 1

keyboardP
keyboardP

Reputation: 69372

You can handle the textbox's KeyUp event and then check the PlatformKeyCode.

 <TextBox Text="TextBox" Width="460" KeyUp="Textbox_KeyUp" />

Then, in your event handler:

private void Textbox_KeyUp(object sender, KeyEventArgs e)
{
     //27 is the PKC for the hardware back button
     if (e.PlatformKeyCode == 27)
     {
         //Backbutton is pressed
     }            
}

Upvotes: 1

Related Questions