internal VirtualizedItemValueCollection GetCachedValuesForItem(object item) { LinkedListNode <VirtualPage> pageNode = m_pageNodes.First; while (pageNode != null) { VirtualList virtualList = pageNode.Value.ParentVirtualList; Debug.Assert(m_managedLists.Contains(virtualList)); int localIndex = virtualList.IndexOf(item); if (localIndex != -1) { return(virtualList.GetCachedValuesForItemAtIndex(localIndex)); } pageNode = pageNode.Next; } return(null); }
public int GetGlobalIndexOf(object item) { ReadOnlyCollection <VirtualList> virtualItemLists = this.ManagedLists; int virtualItemListsCount = virtualItemLists.Count; for (int i = 0; i < virtualItemListsCount; i++) { VirtualList localList = virtualItemLists[i]; int localIndex = localList.IndexOf(item); if (localIndex >= 0) { Debug.Assert(m_virtualListVSCollectionViewGroupDictionary.ContainsKey(localList)); DataGridVirtualizingCollectionViewGroupBase dgvcvg = m_virtualListVSCollectionViewGroupDictionary[localList]; return(localIndex + dgvcvg.StartGlobalIndex); } } return(-1); }
internal void ClearCachedValuesForItem(object item) { LinkedListNode <VirtualPage> pageNode = m_pageNodes.First; while (pageNode != null) { VirtualList virtualList = pageNode.Value.ParentVirtualList; Debug.Assert(m_managedLists.Contains(virtualList)); int localIndex = virtualList.IndexOf(item); if (localIndex != -1) { virtualList.ClearCachedValuesForItemAtIndex(localIndex); return; } pageNode = pageNode.Next; } throw new InvalidOperationException("An attempt was made to leave the edit process on an unknown item."); }