public T NavigateTo <T>() where T : Page { SetPage <T>(); Console.Clear(); CurrentPage.Display(); return(CurrentPage as T); }
public Page NavigateBack() { History.Pop(); Console.Clear(); CurrentPage.Display(); return(CurrentPage); }
public void NavigateHome() { while (History.Count > 1) { History.Pop(); } Console.Clear(); CurrentPage.Display(); }
/// <summary> /// Method for navigate back to the page. /// </summary> /// <typeparam name="T">Navigation page type.</typeparam> /// <returns>Navigation page.</returns> public T NavigateBackTo <T>() where T : Page { while (typeof(T) != History.Peek().GetType()) { History.Pop(); } Console.Clear(); CurrentPage.Display(); return(CurrentPage as T); }
public virtual void Run() { try { Console.Title = Title; CurrentPage.Display(); } catch (Exception e) { Output.WriteLine(ConsoleColor.Red, e.ToString()); } finally { if (Debugger.IsAttached) { Input.ReadString("Press [Enter] to exit"); } } }