public static void PopScreen() { Debug.Print(nameof(PopScreen)); if (ScreenManager._screenList.Count > 0) { ScreenManager.TopScreen.HandlePause(); ScreenManager.TopScreen.HandleDeactivate(); ScreenManager.TopScreen.HandleFinalize(); ScreenManager.OnPopScreenEvent onPopScreen = ScreenManager.OnPopScreen; if (onPopScreen != null) { onPopScreen(ScreenManager.TopScreen); } ScreenManager._screenList.Remove(ScreenManager.TopScreen); } if (ScreenManager._screenList.Count > 0) { ScreenBase topScreen1 = ScreenManager.TopScreen; ScreenManager.TopScreen.HandleActivate(); ScreenBase topScreen2 = ScreenManager.TopScreen; if (topScreen1 == topScreen2) { ScreenManager.TopScreen.HandleResume(); } } ScreenManager.RefreshGlobalOrder(); }
public static void ReplaceTopScreen(ScreenBase screen) { Debug.Print("ReplaceToTopScreen"); if (ScreenManager._screenList.Count > 0) { ScreenManager.TopScreen.HandlePause(); ScreenManager.TopScreen.HandleDeactivate(); ScreenManager.TopScreen.HandleFinalize(); ScreenManager.OnPopScreenEvent onPopScreen = ScreenManager.OnPopScreen; if (onPopScreen != null) { onPopScreen(ScreenManager.TopScreen); } ScreenManager._screenList.Remove(ScreenManager.TopScreen); } ScreenManager._screenList.Add(screen); screen.HandleInitialize(); screen.HandleActivate(); screen.HandleResume(); ScreenManager.RefreshGlobalOrder(); ScreenManager.OnPushScreenEvent onPushScreen = ScreenManager.OnPushScreen; if (onPushScreen == null) { return; } onPushScreen(screen); }
public static void CleanScreens() { Debug.Print(nameof(CleanScreens)); while (ScreenManager._screenList.Count > 0) { ScreenManager.TopScreen.HandlePause(); ScreenManager.TopScreen.HandleDeactivate(); ScreenManager.TopScreen.HandleFinalize(); ScreenManager.OnPopScreenEvent onPopScreen = ScreenManager.OnPopScreen; if (onPopScreen != null) { onPopScreen(ScreenManager.TopScreen); } ScreenManager._screenList.Remove(ScreenManager.TopScreen); } ScreenManager.RefreshGlobalOrder(); }