public MudComponent Add(MudComponent component) { if (Has(component.Name)) { return(null); } _components.Add(component); //TODO: listeners notify that trait was added return(component); }
bool IsSubGroupExpanded(MudComponent item) { #region comment about is subgroup expanded //if the route contains any of the links of the subgroup, then the subgroup //should be expanded //Example: //subgroup: form inputs & controls //the subgroup "form inputs & controls" should be open if the current page has in the route //a component included in the subgroup elements, that in this case are autocomplete, form, field, //radio, select... //this route `/components/autocomplete` should open the subgroup "form inputs..." #endregion return(item.GroupItems.Elements.Any(i => i.Link == _componentLink)); }