public void SetGroupCollapseState(GroupableField field, string groupName, bool collapsed) { if (collapsed) { if (!collapsedGroups.ContainsKey(field)) { collapsedGroups.Add(field, new List <string>()); } if (!collapsedGroups[field].ContainsString(groupName, StringComparison.OrdinalIgnoreCase)) { collapsedGroups[field].Add(groupName); OnPropertyChanged(nameof(CollapsedGroups)); } } else { if (collapsedGroups.ContainsKey(field)) { var existing = collapsedGroups[field].FirstOrDefault(a => string.Equals(a, groupName, StringComparison.OrdinalIgnoreCase)); if (existing != null) { collapsedGroups[field].Remove(existing); } if (collapsedGroups[field].Count == 0) { collapsedGroups.Remove(field); } OnPropertyChanged(nameof(CollapsedGroups)); } } }
public void ExpandAllGroups(GroupableField field) { if (collapsedGroups.ContainsKey(field)) { collapsedGroups.Remove(field); OnPropertyChanged(nameof(CollapsedGroups)); } }
public bool IsGroupCollapsed(GroupableField field, string groupName) { if (collapsedGroups.ContainsKey(field) && collapsedGroups[field].ContainsString(groupName, StringComparison.OrdinalIgnoreCase)) { return(true); } return(false); }
public void CollapseGroups(GroupableField field, List <string> groupNames) { if (!collapsedGroups.ContainsKey(field)) { collapsedGroups.Add(field, new List <string>()); } foreach (var groupName in groupNames) { if (!collapsedGroups[field].ContainsString(groupName, StringComparison.OrdinalIgnoreCase)) { collapsedGroups[field].Add(groupName); } } OnPropertyChanged(nameof(CollapsedGroups)); }
public ExplorableField(GroupableField field) { Field = field; }