public NavigationBuilder Add(string caption, string position, Action<NavigationItemBuilder> itemBuilder) { var childBuilder = new NavigationItemBuilder(); if (!string.IsNullOrEmpty(caption)) childBuilder.Caption(caption); if (!string.IsNullOrEmpty(position)) childBuilder.Position(position); itemBuilder(childBuilder); Contained = (Contained ?? Enumerable.Empty<MenuItem>()).Concat(childBuilder.Build()); 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.AddRange(childBuilder.Build()); if (classes != null) { foreach (var className in classes) childBuilder.AddClass(className); } return this; }
public NavigationBuilder Add(string caption, string position, Action <NavigationItemBuilder> itemBuilder) { var childBuilder = new NavigationItemBuilder(); if (!string.IsNullOrEmpty(caption)) { childBuilder.Caption(caption); } if (!string.IsNullOrEmpty(position)) { childBuilder.Position(position); } itemBuilder(childBuilder); Contained = (Contained ?? Enumerable.Empty <MenuItem>()).Concat(childBuilder.Build()); return(this); }
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); }