0

I am working on WP7 Phonegap app. I have used below code to handle back button, but whenever I click back button , back button event is not cancelled and application gets exited.

        void OnBackKeyPressed(object sender, CancelEventArgs e)
        {
            var result = MessageBox.Show("Dof fd fd  you want to exit?", "Attention!",
                                          MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                // Do not cancel navigation
                return;
            }
            e.Cancel = true;
        }

Please helpme on same. Thanks in advance.

CodeGuru
  • 2,722
  • 6
  • 36
  • 52
Shashant Dahikar
  • 252
  • 4
  • 16

1 Answers1

0

One of the lead devs for the Windows Phone implementation of PhoneGap recently wrote about correctly handling the back button.
See his article at http://www.risingj.com/archives/493

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143