private int GetRealizedItemBlockCount(RealizedItemBlock rib, int end, bool returnLocalIndex) { if (!IsGrouping || returnLocalIndex) { // when the UI is not grouping, each item counts as 1, even // groups (bug 1761421) return end; } int count = 0; for (int offset = 0; offset < end; ++offset) { CollectionViewGroup group; if ((group = rib.ItemAt(offset) as CollectionViewGroup) != null) { // found a group, count the group count += group.ItemCount; } else { count++; } } return count; }
private int GetRealizedItemBlockCount(RealizedItemBlock rib, int end) { if (!IsGrouping) { // when the UI is not grouping, each item counts as 1, even // groups (bug 1761421) return end; } int count = 0; for (int offset = 0; offset < end; ++offset) { CollectionViewGroup group; if ((group = rib.ItemAt(offset) as CollectionViewGroup) != null) { // found a group, count the group GroupItem groupItem = (GroupItem)rib.ContainerAt(offset); count += groupItem.Generator.GetCount(); } else { count++; } } return count; }