示例#1
0
        public T NavigateTo <T>() where T : Page
        {
            SetPage <T>();

            Console.Clear();
            CurrentPage.Display();
            return(CurrentPage as T);
        }
示例#2
0
        public Page NavigateBack()
        {
            History.Pop();

            Console.Clear();
            CurrentPage.Display();
            return(CurrentPage);
        }
示例#3
0
        public void NavigateHome()
        {
            while (History.Count > 1)
            {
                History.Pop();
            }

            Console.Clear();
            CurrentPage.Display();
        }
示例#4
0
        /// <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);
        }
示例#5
0
        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");
                }
            }
        }