Windows Phone 7, login screen redirect and a case for .exit?

Posted by Jarrette on Stack Overflow See other posts from Stack Overflow or by Jarrette
Published on 2011-06-24T17:42:48Z Indexed on 2011/06/25 0:22 UTC
Read the original article Hit count: 195

I know this has been discussed ad nauseum, but I want to present my case.... 1. My start page in my app is login.xaml. The user logs in, the username and password are authenticated through my WCF service, the username is saved in isolated storage, and then the user is redirected to mainpage.xaml.

  1. When a user starts my app, and they already have a saved username in isolated storage, they are redirected to mainpage.xaml

  2. If the user hit's "back" hard button from mainpage.xaml, they are redirected to the login screen, which in turn redirects them back to the mainpage.xaml since they already have a saved local username. This is causing my app to fail certification currently since the user cannot hit the "back" button to exit the app from mainpage.xaml.

My instinct here is to override the BackKeyPress in mainpage.xaml and exit the app somehow. By reading the other posts, I can see that this method is not available. My second idea was to somehow store a property in the app.xaml.cs page that would tell the app to exit when the login page is loaded and that property is set to true, but that seems a bit hacky as well....

Any ideas here?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Windows