public static void PushScreen(Screen newScreen) { PushingScreen(new Object(), new PushingScreenArgs(newScreen, (_currentScreen.Count > 0) ? _currentScreen.Peek() : null)); //Do not begin to load till finished drawing while (isDrawing) { } isLoading = true; //Pop all Old Screens to Base screen /*while (!(_currentScreen.Peek() is Base)) { Console.Write("Popping old Screen..."); Console.WriteLine("DONE"); } Console.WriteLine("Screen Stack popped down to Base screen.");*/ //Push the new Screen to the top of the Stack Console.Write("Pushing the new Screen..."); CurrentScreen.Push(newScreen); Console.WriteLine("DONE"); //Load the new Screen Console.Write("Loading new Screen..."); CurrentScreen.Peek().Load(); Console.WriteLine("DONE"); isLoading = false; Console.WriteLine("New Screen successfully pushed."); }
public PushingScreenArgs(Screen newScreen, Screen oldScreen) { _newScreen = newScreen; _oldScreen = oldScreen; }