Windows 8–Storing App Data

While your Windows 8 Store application is running, you want to be saving data all the time. After all, the user can switch to another application at any time, and you only have five seconds to store out your data at that point.

While that is true for major data points, there are certain “status” values that you want to store only at the last minute. This might include which information is visible, what is selected, user input data, and so forth.

A great way to store that information is in an ApplicationDataContainer. This can be stored with your local settings or your roaming settings, but it requires no special permission from the operating system; these files are considered safe.

To see this, let’s create an application that stores, restores and deletes application data. Our UI is very simple, a text box to put information into, a textBlock to display recalled information, and three buttons:

About Jesse Liberty

Jesse Liberty is an independent consultant and programmer with three decades of experience writing and delivering software projects. He is the author of 2 dozen books and multiple Pluralsight courses, and has been a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Xamarin Certified Mobile Developer and a Xamarin MVP, Microsoft MVP and Telerik MVP.