Reputation: 31
I currently have a UWP app that I am working on that has multiple pages that are accessed by selecting and moving through different tabs as shown below.
Tabs for my different pages that a user can browse through
However when moving between these pages, any input or interactions the user had on that page are reset. This includes drop down selections, text input and the whole XML file they are working with (the blank space below is where an xml file string is generated).
Potential user inputs that I would want saved
Thus I would want to know a way to save these inputs (mainly just the strings that are created) hopefully without using serialisation or a form of it but just so that, by default, the user can browse between all the different UWP pages and make changes that are saved so they can look at later.
Any suggestions or advice is appreciated!
Upvotes: 1
Views: 216
Reputation: 5868
How to save user selections when moving between different pages in UWP
Page content and state is not cached by default, so if you'd like to cache information(e.g. save the input or interactions), you could enable it in each page of your app. To change the value of NavigationCacheMode programmatically to Enabled or Required, you can only set these values in the constructor for the page. For exmaple:
public CachePage()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
}
For more details about this, you can refer to this document.
Upvotes: 4