////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public NavRoot GetRoot()
        {
            if (vRootLevel == null)
            {
                vRootLevel = new NavLevel(GetChildItems);
                vRoot.Build(vRootLevel);
            }

            return(vRoot);
        }
예제 #2
0
        /*--------------------------------------------------------------------------------------------*/
        private void SetNewLevel(NavLevel pNewLevel, int pDirection)
        {
            if (vCurrLevel != null)
            {
                vCurrLevel.OnItemSelected -= HandleItemSelected;
                vCurrLevel.SetActiveOnLevelChange(false, pDirection);
            }

            vCurrLevel = pNewLevel;
            vCurrLevel.OnItemSelected += HandleItemSelected;
            vCurrLevel.SetActiveOnLevelChange(true, pDirection);

            OnLevelChange(pDirection);
        }
예제 #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void HandleItemSelected(NavLevel pLevel, NavItem pItem)
        {
            vDelgate.HandleItemSelection(pLevel, pItem);

            if (pItem.Type == NavItem.ItemType.Parent)
            {
                vHistory.Push(vCurrLevel);
                SetNewLevel(pItem.ChildLevel, 1);
                return;
            }

            if (pItem.NavigateBackUponSelect)
            {
                Back();
            }
        }
예제 #4
0
        /*--------------------------------------------------------------------------------------------*/
        public string GetLevelTitle()
        {
            NavLevel level = GetParentLevel();

            return(level == null ? vDelgate.GetTopLevelTitle() : level.LastSelectedParentItem.Label);
        }
예제 #5
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public NavItemParent(string pLabel, float pRelativeSize = 1) :
     base(ItemType.Parent, pLabel, pRelativeSize)
 {
     ChildLevel = new NavLevel();
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 public NavItemParent(Func <NavItem[]> pGetItems) : base(ItemType.Parent)
 {
     ChildLevel = new NavLevel(pGetItems);
 }
예제 #7
0
 /*--------------------------------------------------------------------------------------------*/
 public void Build(NavLevel pRootLevel)
 {
     SetNewLevel(pRootLevel, 0);
 }