Windows Phone 7 : Handling Hardware Back Button

Windows Phone 7 : Handling Hardware Back Button

  • Comments 1

Often user presses hardware back button while inside an application. This would send the existing application to the background and let other be on top. Most of the times this is acceptable but sometimes application requires user to choose whether to go back or notify about it. Handling back button through code,

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
    e.Cancel = true; //Cancelling the default back option
    MessageBox.Show("You have pressed hardware back button");            
}

Namosakr!!!

Leave a Comment
  • Please add 2 and 5 and type the answer here:
  • Post
Page 1 of 1 (1 items)