views:

12

answers:

1

Hi,

I have an application where from the MainPage.xaml I navigate to a page called say two.xaml.

In Two.xaml I then navigate to Three.xaml..

Now for Three.xaml I want to navigate back to the mainPage.Xaml.

In Three.xaml if I do this.NavigationService.GoBack(); this.NavigationService.GoBack();

I get an InvalidOperationException.

If I do NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));

the system will crate another instance of MainPage.xaml, which I do not want as it will lose its original state.

Anyone have solutions to this issue? Thanks

+1  A: 

Hi Allen Ho,

you can save the actual state for example in the State-Property of the PhoneApplicationService Class, then Navigate through your pages and when getting back to the MainPage you just implement the OnNavigatedTo()-method of the MainPage and load the State-Data.

Hope this helps...

cordellcp3