Skip to main content
remove apology
Source Link
usefulBee
  • 9.9k
  • 10
  • 57
  • 97

Is there any posibility to keep content of page after navigate of it. For example I have Window with frame and few buttons and every button navigate on some page.

frame.Navigate(new Page1()); //every button for different page 

Now one page for example have some textblock and button. If a click on button text of textblock change. When I go to some other page and come back to that page the textblock.Text will not be saved, it will back to default value? How to keep it?

I know in wp 8.1 you can do it with this line of code in constructor:

this.NavigationCacheMode = NavigationCacheMode.Required; 

but, I can't find how to the the same in WPF.

Sorry for my bad English...

Is there any posibility to keep content of page after navigate of it. For example I have Window with frame and few buttons and every button navigate on some page.

frame.Navigate(new Page1()); //every button for different page 

Now one page for example have some textblock and button. If a click on button text of textblock change. When I go to some other page and come back to that page the textblock.Text will not be saved, it will back to default value? How to keep it?

I know in wp 8.1 you can do it with this line of code in constructor:

this.NavigationCacheMode = NavigationCacheMode.Required; 

but, I can't find how to the the same in WPF.

Sorry for my bad English...

Is there any posibility to keep content of page after navigate of it. For example I have Window with frame and few buttons and every button navigate on some page.

frame.Navigate(new Page1()); //every button for different page 

Now one page for example have some textblock and button. If a click on button text of textblock change. When I go to some other page and come back to that page the textblock.Text will not be saved, it will back to default value? How to keep it?

I know in wp 8.1 you can do it with this line of code in constructor:

this.NavigationCacheMode = NavigationCacheMode.Required; 

but, I can't find how to the the same in WPF.

Source Link
ja13
  • 89
  • 2
  • 8

Navigating between pages in WPF

Is there any posibility to keep content of page after navigate of it. For example I have Window with frame and few buttons and every button navigate on some page.

frame.Navigate(new Page1()); //every button for different page 

Now one page for example have some textblock and button. If a click on button text of textblock change. When I go to some other page and come back to that page the textblock.Text will not be saved, it will back to default value? How to keep it?

I know in wp 8.1 you can do it with this line of code in constructor:

this.NavigationCacheMode = NavigationCacheMode.Required; 

but, I can't find how to the the same in WPF.

Sorry for my bad English...