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.
The ways for storing such data are as follows:Databases. Structured storages. Archives (as a specific form of structured storage) Remote (distributed, cloud) storages.
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.
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.
You could try this:
Window.Current.Activated += (sender, args) =>
{
if (args.WindowActivationState ==
CoreWindowActivationState.Deactivated)
; //save data
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With