예제 #1
0
 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();
 }
예제 #2
0
 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);
 }
예제 #3
0
 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();
 }