Пример #1
0
        public async Task ToggleSubMenuAsync(BaseMatNavSubMenu subMenu)
        {
            if (!MatNavMenu.Multi)
            {
                if (subMenu.Expanded)
                {
                    var current = CurrentNavSubMenu;
                    CurrentNavSubMenu = subMenu;

                    if (current != null && current != subMenu && current.Expanded)
                    {
                        await current.ToggleAsync();
                    }
                }
            }
        }
Пример #2
0
        public async Task ToggleSelectedAsync(BaseMatNavItem navItem, BaseMatNavSubMenu navSubMenu)
        {
            if (navItem.Selected)
            {
                var currentNavItem = CurrentNavItem;
                CurrentNavItem = navItem;

                if (currentNavItem != null && currentNavItem != navItem && currentNavItem.Selected)
                {
                    await currentNavItem.ToggleSelectedAsync();
                }
            }

            if (navSubMenu != null)
            {
                await navSubMenu.ToggleSelectedAsync();

                CurrentSelectedNavSubMenu = navSubMenu;
            }
            else
            {
                CurrentSelectedNavSubMenu = null;
            }
        }