public NavigationBuilder Add(LocalizedString caption, string position, Action<NavigationItemBuilder> itemBuilder, IEnumerable<string> classes = null) {
            var childBuilder = new NavigationItemBuilder();
            
            childBuilder.Caption(caption);
            childBuilder.Position(position);
            itemBuilder(childBuilder);
            Contained.AddRange(childBuilder.Build());

            if (classes != null) {
                foreach (var className in classes) 
                    childBuilder.AddClass(className);
            }

            return this;
        }
Ejemplo n.º 2
0
        public NavigationBuilder Add(string caption, string position, Action <NavigationItemBuilder> itemBuilder, IEnumerable <string> classes = null)
        {
            var childBuilder = new NavigationItemBuilder();

            childBuilder.Caption(caption);
            childBuilder.Position(position);
            itemBuilder(childBuilder);
            Contained.AddRange(childBuilder.Build());

            if (classes != null)
            {
                foreach (var className in classes)
                {
                    childBuilder.AddClass(className);
                }
            }
            return(this);
        }
        public NavigationBuilder Add(LocalizedString caption, string position, Action <NavigationItemBuilder> itemBuilder, IEnumerable <string> classes = null)
        {
            var childBuilder = new NavigationItemBuilder();

            childBuilder.Caption(caption);
            childBuilder.Position(position);
            itemBuilder(childBuilder);
            Contained = (Contained ?? Enumerable.Empty <MenuItem>()).Concat(childBuilder.Build());

            if (classes != null)
            {
                foreach (var className in classes)
                {
                    childBuilder.AddClass(className);
                }
            }

            return(this);
        }