Пример #1
0
        private bool RemoveFromGroupDirectly(CollectionViewGroupInternal group, object item)
        {
            int index = group.Remove(item, true);

            if (index < 0)
            {
                return(true);
            }
            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));
            return(false);
        }
Пример #2
0
        private void RemoveEmptyGroup(CollectionViewGroupInternal group)
        {
            CollectionViewGroupInternal parent = group.Parent;

            if (parent == null)
            {
                return;
            }
            GroupDescription groupBy = parent.GroupBy;

            if (parent.ProtectedItems.IndexOf((object)group) < groupBy.GroupNames.Count)
            {
                return;
            }
            parent.Remove((object)group, false);
        }