Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I save application data in WinRT?

In WinRT the Suspended event is supposed to be used to save application data. It is even written in the templates that come with Visual Studio. However when the user closes the app the Suspended event does not fire until 10 seconds later. If the user starts the application in the meantime the data is lost. How should I proceed in this case? I tried other events like page's NavigatedFrom but none of them fired.

like image 881
Stilgar Avatar asked Nov 07 '12 16:11

Stilgar


People also ask

How is application data stored?

The ways for storing such data are as follows:Databases. Structured storages. Archives (as a specific form of structured storage) Remote (distributed, cloud) storages.

What is application data?

App data is the data that is downloaded or generated as part of a device's content - for instance, downloaded books or music, while cache files are temporary files many programs generate while in use, such as saved portions of websites you visit in a browser.

Where can I find application data?

AppData is a hidden folder located in C:\Users\<username>\AppData. The AppData folder contains custom settings and other information needed by applications. For example, you might find the following in your AppData folder: Web browser bookmarks and cache. Application configuration files.


1 Answers

You could try this:

        Window.Current.Activated += (sender, args) =>
        {
            if (args.WindowActivationState ==
                CoreWindowActivationState.Deactivated)
                ; //save data
        };
like image 97
Filip Skakun Avatar answered Nov 15 '22 10:11

Filip Skakun