Friday, February 10, 2012

Windows Phone 7–Application Lifecycle

MSDN reference on the WP7 application lifecycle: http://msdn.microsoft.com/en-us/library/ff817008(VS.92).aspx

Execution Model Diagram for Windows Phone 7.5

And remember to enable “Fast Application Switching” (FAS) in your app, all you need to do is to check the IsApplicationStatePreserved property and perform state loading only if the property is false.

private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            if (!e.IsApplicationInstancePreserved)
            {
                LoadStateFromStorage();
            }
        }

No comments: