// Code to execute when the application is deactivated (sent to background) // This code will not execute when the application is closing private void Application_Deactivated(object sender, DeactivatedEventArgs e) { ApplicationRunData.SaveState(PhoneApplicationService.Current.State); ServiceCentral.SaveState(PhoneApplicationService.Current.State); }
// Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { ApplicationRunData.LoadState(PhoneApplicationService.Current.State); ServiceCentral.LoadState(PhoneApplicationService.Current.State); }