Esempio n. 1
0
        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));
                }
            }
        }
Esempio n. 2
0
 public void ExpandAllGroups(GroupableField field)
 {
     if (collapsedGroups.ContainsKey(field))
     {
         collapsedGroups.Remove(field);
         OnPropertyChanged(nameof(CollapsedGroups));
     }
 }
Esempio n. 3
0
        public bool IsGroupCollapsed(GroupableField field, string groupName)
        {
            if (collapsedGroups.ContainsKey(field) &&
                collapsedGroups[field].ContainsString(groupName, StringComparison.OrdinalIgnoreCase))
            {
                return(true);
            }

            return(false);
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
 public ExplorableField(GroupableField field)
 {
     Field = field;
 }