I hava a WP 7.5 app. I have a splash screen and then comes my MainPage.xaml that has a copyright disclaimer and Start Button. User clicks the button and it goes to our home screen(Home.xaml) where user can start core interaction with the app.
What I want is:
1: The copyright screen i.e. MainPage.xaml should appear only the very first time the user start the application after installing it. Upon subsequent start from the application menu or Tile(s), I don’t want to show copyright Page.
2: Same thing that once user click the Start/Accept button and goes to the Home.xaml, he or she cannot go back to MainPage.xaml by clicking the back-button but instead clicking back from home screen, they should exit the application.
What I did so far:
1: For MainPage.xaml’s OnNavigateTo I check for an ApplicationSetting key, showCopyright. If it is not found or true, I do nothing. If it is false, then I use NavigationService.Navigate to my Home.xaml.
2: Upon Start/Accept button, I set the ApplicationSettings key to false.
Problem with the above approach:
1: If I use back button from HomeScreen, I go into infinite loop. The app should exit but it doesn’t.
Questions:
1: Is the above approach right or is there a better approach?
2: If I am in right direction, how do I make my application exit upon back button when I am on Home.xaml?
Thanks, any pointers please?
Edit: For the records sake– I found a nice explanation here about explicit Exit from Windows Phone application. As of WP7.1/7.5, there is no built-in way to Exit an Silverlight WP app explicitly.
You can remove Backentry of the Navigation service in the new page(Home.xaml) on the back key press which makes breaks the infinite loop.
Please add the following code in the Home.xaml.cs and try