示例#1
0
        public MenuTree GetItems(MenuDisplayMode mode)
        {
            MenuTree tree = new MenuTree(Id, Title);

            tree.AddRange <MenuItem>(this.Where((item) => {
                return(item.Mode.HasFlag(mode));
            }));

            return(tree);
        }
示例#2
0
        public SubmenuButton SubmenuButton(MenuDisplayMode displayMode, string id, string name,
                                           MenuTree menuTree, string description = null)
        {
            var submenuButton = new SubmenuButton(displayMode, id, name)
                                .NavigatesTo(menuTree)
                                .WithDescription(description);

            Add(submenuButton);

            return(submenuButton as SubmenuButton);
        }