// Do not add any additional code to this method private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) { Debug.WriteLine("Complete Initialize Application " + DateTime.Now + " " + sender.ToString() + " " + e.ToString()); // Set the root visual to allow the application to render if (RootVisual != RootFrame) RootVisual = RootFrame; // Remove this handler since it is no longer needed RootFrame.Navigated -= CompleteInitializePhoneApplication; }
protected override void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); Debug.WriteLine("MainPage OnNavigatedFrom " + DateTime.Now + " " + e.ToString()); }
private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) { Debug.WriteLine("Clear Back Stack After Reset " + DateTime.Now + " " + sender.ToString() + " " + e.ToString()); // Unregister the event so it doesn't get called again RootFrame.Navigated -= ClearBackStackAfterReset; // Only clear the stack for 'new' (forward) and 'refresh' navigations if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) return; // For UI consistency, clear the entire page stack while (RootFrame.RemoveBackEntry() != null) { ; // do nothing } }