/// <summary>
 /// Closes the current menu and returns to the previous menu.
 /// </summary>
 public void Close()
 {
     if (previousMenus.Count > 0)
     {
         activeMenu = previousMenus.Pop();
     }
     else
     {
         Exit();
     }
 }
 /// <summary>
 /// Closes all menus.
 /// </summary>
 public void Exit()
 {
     activeMenu = null;
     IsActive = false;
 }
        public void AddMenu(string name, Menu menu)
        {
            Menus.Add(name, menu);

            activeMenu = menu;
        }