Presentation on theme: "Part 2: Manage app lifecycle and state (Windows Store apps using C#/VB and XAML) us/library/windows/apps/hh986968.aspx"— Presentation transcript:
Part 2: Manage app lifecycle and state (Windows Store apps using C#/VB and XAML) us/library/windows/apps/hh aspx us/library/windows/apps/hh aspx
Life cycle An app can be suspended The user switches away from it Windows enters a low power state. Windows can terminate a suspended app to free up memory to save power. When your app is terminated, it stops running and is unloaded from memory. The user can close an app pressing Alt+F4 or using the close gesture, the app is suspended for 10 seconds and then terminated. The app needs to retain any data the user entered!!
Two types of data app data is persistent across sessions must always be accessible to the user. Always save important app data incrementally your app has only up to five seconds to run code Windows.Storage.ApplicationData manage your app data. session data A session ends when the user closes the app using the close gesture or Alt + F4, reboots the computer, or logs off the computer The SuspensionManager class. It saves and restores the navigation state of the Frame serializes the page state data and writes it to an XML file in your app's local storage.