Hello.
Just use the navigation cache NavigationCacheMode
. There are three modes:
NavigationCacheMode = NavigationCacheMode.Disabled
- The page is not cached, that is, after exiting the screen and returning, the screen will be rebooted.
NavigationCacheMode = NavigationCacheMode.Enabled
- The page will be cached as long as there is leftover memory, but if the application needs more memory, it will be cached.
NavigationCacheMode = NavigationCacheMode.Required
- The page is kept cached at all costs, even if there is no more memory available.
Add this at page startup, right after the InitializeComponent()
After this, when navigating to the second screen and returning the home screen will remain unchanged (if you choose the option Required
or Enabled
).
Note that the cache control is done individually on each page. Page 1 cache will not affect page 2.
Would you like the item?
– Deivid Farias
No, whenever I select an item and navigate to the other screen, on the way back it doesn’t click where I left it, it reloads the list as if it had opened the app for the first time
– Leandrolap
There is no way to save the index of the selected item, like the cookie we use on web pages?
– Deivid Farias
Well, then I have to think of something. Until now I have 41 items in gridview, until I reach 39 I have to slide my finger on the screen until I arrive, after I click and navigate to the second screen and back, I will have to slide everything again to arrive and select item 40.
– Leandrolap