コード例 #1
0
ファイル: ViewManager.cs プロジェクト: blakepell/ModernWpf
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        private bool ClearElementToUniqueIdResetPool(UIElement element, VirtualizationInfo virtInfo)
        {
            if (m_isDataSourceStableResetPending)
            {
                m_resetPool.Add(element);
                virtInfo.MoveOwnershipToUniqueIdResetPoolFromLayout();
            }

            return(m_isDataSourceStableResetPending);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: ViewManager.cs プロジェクト: blakepell/ModernWpf
        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();
            }
コード例 #6
0
        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);
        }