Say I have two pages, A and B.
The user can modify things on page A then navigate to page B. When he is on page B, he clicks the "Back" button to go to page A. Everything that has been done previously is lost.
There is a way to get the exact same state by using
this.NavigationCacheMode =
Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
But is there a way to know whether the page is opened for the first time a by using the back button?
yes it is:
You also should've a look at
ApplicationExecutionState
(inOnLaunched
event in App.xaml). If you navigate to Page B, Apps suspends, App continues, user navigates to Page A theNavigationMode
will beNew
!