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); }
//------------------------------------------------------ // // Private Methods // //------------------------------------------------------ /// <summary> /// Removes an empty group from the PagedCollectionView grouping /// </summary> /// <param name="group">Empty subgroup to remove</param> private static void RemoveEmptyGroup(CollectionViewGroupInternal group) { CollectionViewGroupInternal parent = group.Parent; if (parent != null) { GroupDescription groupBy = parent.GroupBy; int index = parent.ProtectedItems.IndexOf(group); // remove the subgroup unless it is one of the explicit groups if (index >= groupBy.GroupNames.Count) { parent.Remove(group, false); } } }
/// <summary> /// Remove an item from the direct children of a group. /// </summary> /// <param name="group">Group to remove item from</param> /// <param name="item">Item to remove</param> /// <returns>True if item could not be removed</returns> private bool RemoveFromGroupDirectly(CollectionViewGroupInternal group, object item) { int leafIndex = group.Remove(item, true); if (leafIndex >= 0) { this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, leafIndex)); return false; } else { return true; } }
private bool RemoveFromGroupDirectly(CollectionViewGroupInternal group, object item) { int num = group.Remove(item, true); if (num >= 0) { this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(1, item, num)); return false; } return true; }