예제 #1
0
파일: panel.cs 프로젝트: dox0/DotNet471RS3
        private void MoveChildren(GeneratorPosition fromPos, GeneratorPosition toPos, int containerCount)
        {
            if (fromPos == toPos)
                return;

            Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Move action from a generator.");

            IItemContainerGenerator generator = (IItemContainerGenerator)_itemContainerGenerator;
            int toIndex = generator.IndexFromGeneratorPosition(toPos);

            UIElement[] elements = new UIElement[containerCount];

            for (int i = 0; i < containerCount; i++)
                elements[i] = _uiElementCollection[fromPos.Index + i];

            _uiElementCollection.RemoveRangeInternal(fromPos.Index, containerCount);

            for (int i = 0; i < containerCount; i++)
            {
                _uiElementCollection.InsertInternal(toIndex + i, elements[i]);
            }
        }
예제 #2
0
 // This is internal as an optimization for VirtualizingStackPanel (so it doesn't need to re-query InternalChildren repeatedly)
 internal static void RemoveInternalChildRange(UIElementCollection children, int index, int range)
 {
     children.RemoveRangeInternal(index, range);
 }
예제 #3
0
 // This is internal as an optimization for VirtualizingStackPanel (so it doesn't need to re-query InternalChildren repeatedly)
 internal static void RemoveInternalChildRange(UIElementCollection children, int index, int range)
 {
     children.RemoveRangeInternal(index, range);
 }