ispiro
ispiro

Reputation: 27723

Persist Page-state when navigating between Pages

I want to let the user use a phone's back button in order to return to a previous screen. In order to do that I thought of using frame.Navigate(). However, this means that I need to supply a Type instead of a specific Page. But I want the user to return to the original Page as it was left. So how do I achieve that?

If I'm using the wrong method for this, please let me know. I want to use whatever is the correct method for doing this.

Upvotes: 0

Views: 434

Answers (2)

Romasz
Romasz

Reputation: 29792

Set NavigationCacheMode of your Page to 'Required'. Then page state should be cached.

Note also that OS can free resources in some cases, so be also prepared for fresh page.

Upvotes: 1

thang2410199
thang2410199

Reputation: 1942

To return to previous screen, use Frame.GoBack. Your old page is intact in navigation stack.

Upvotes: 1

Related Questions