protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (ApplicationState.ApplicationStartup == AppOpenState.Launching) { ApplicationState.AppLaunchInitialization(); } if (ApplicationState.ApplicationStartup == AppOpenState.Activated && IsPageActived) { if (ApplicationState.RetrieveAppObjects()) { RefreshFromAppState(); } else { ApplicationState.AppActivatedInitialization(); } } ApplicationState.ApplicationStartup = AppOpenState.None; IsPageActived = true; }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); int numOfHistory = NavigationService.BackStack.Count(); for (int i = 0; i < numOfHistory; i++) { NavigationService.RemoveBackEntry(); } if (ApplicationState.ApplicationStartup == AppOpenState.Launching) { ApplicationState.AppLaunchInitialization(); } if (ApplicationState.ApplicationStartup == AppOpenState.Activated && IsPageActived) { if (ApplicationState.RetrieveAppObjects()) { RefreshFromAppState(); } else { ApplicationState.AppActivatedInitialization(); } } ApplicationState.ApplicationStartup = AppOpenState.None; IsPageActived = true; }
/// <summary> /// Background thread work for loading /// The loading of the supported conversions from the Xap as well as the /// favorites from isolated storage is done on a non UI thread to allow the /// fastest possible page render /// </summary> /// <param name="sender">worker thread object</param> /// <param name="e">Action delegate for completion</param> private void DeferStartupWork(object sender, DoWorkEventArgs e) { Action completed = e.Argument as Action; lock (threadLock) { ApplicationState.AppLaunchInitialization(); this.SetDefaultCategoryAndUnits(); ApplicationState.Favorites = FavoriteCollection.LoadFromFile() ?? new FavoriteCollection(); } if (completed != null) { completed(); } }
/// <summary> /// Background thread work for loading /// The loading of the supported conversions from the Xap as well as the /// favorites from isolated storage is done on a non UI thread to allow the /// fastest possible page render /// </summary> /// <param name="sender">worker thread object</param> /// <param name="e">Action delegate for completion</param> private void DeferStartupWork(object sender, DoWorkEventArgs e) { Action completed = e.Argument as Action; lock (threadLock) { try { ApplicationState.AppLaunchInitialization(); //ScheduledActionManager.ClearExpirationAlarms(); } catch { } AllowNavigation = true; } if (completed != null) { completed(); } }