Hello.
Just use the Navigation Cache NavigationCacheMode
. There are three modes:
NavigationCacheMode = NavigationCacheMode.Disabled
- The page is not cached, ie after exiting the screen and returning, the screen will be reset.
NavigationCacheMode = NavigationCacheMode.Enabled
- The page will be cached while there is more memory, but if the application needs more memory, it will be released from the cache.
NavigationCacheMode = NavigationCacheMode.Required
- The page is cached at all costs, even if there is no more memory available.
Add this to page initialization, right after InitializeComponent()
After this, navigating to the second screen and returning to the home screen will remain unchanged (if you choose the option Required
or Enabled
).
Remember that the cache control is done individually on each page. The page 1 cache will not affect page 2.