public int GetElementIndex(VirtualizationInfo virtInfo) { if (virtInfo == null) { throw new ArgumentNullException(nameof(virtInfo), "Element is not a child of this ItemsRepeater."); } return(virtInfo.IsRealized || virtInfo.IsInUniqueIdResetPool ? virtInfo.Index : -1); }
private void UpdateElementIndex(UIElement element, VirtualizationInfo virtInfo, int index) { var oldIndex = virtInfo.Index; if (oldIndex != index) { virtInfo.UpdateIndex(index); m_owner.OnElementIndexChanged(element, oldIndex, index); } }
private bool ClearElementToUniqueIdResetPool(UIElement element, VirtualizationInfo virtInfo) { if (m_isDataSourceStableResetPending) { m_resetPool.Add(element); virtInfo.MoveOwnershipToUniqueIdResetPoolFromLayout(); } return(m_isDataSourceStableResetPending); }
public int GetElementIndex(VirtualizationInfo virtInfo) { if (virtInfo == null) { //Element is not a child of this ItemsRepeater. return(-1); } return(virtInfo.IsRealized || virtInfo.IsInUniqueIdResetPool ? virtInfo.Index : -1); }
private bool ClearElementToPinnedPool(UIElement element, VirtualizationInfo virtInfo, bool isClearedDueToCollectionChange) { bool moveToPinnedPool = !isClearedDueToCollectionChange && virtInfo.IsPinned; if (moveToPinnedPool) { # if DEBUG for (int i = 0; i < m_pinnedPool.Count; ++i) { Debug.Assert(m_pinnedPool[i].PinnedElement != element); } #endif m_pinnedPool.Add(new PinnedElementInfo(element)); virtInfo.MoveOwnershipToPinnedPool(); }
private bool ClearElementToAnimator(UIElement element, VirtualizationInfo virtInfo) { bool cleared = m_owner.AnimationManager.ClearElement(element); if (cleared) { int clearedIndex = virtInfo.Index; virtInfo.MoveOwnershipToAnimator(); if (m_lastFocusedElement == element) { // Focused element is going away. Remove the tracked last focused element // and pick a reasonable next focus if we can find one within the layout // realized elements. MoveFocusFromClearedIndex(clearedIndex); } } return(cleared); }