コード例 #1
0
ファイル: panel.cs プロジェクト: dox0/DotNet471RS3
        private void AddChildren(GeneratorPosition pos, int itemCount)
        {
            Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Add action from a generator.");

            IItemContainerGenerator generator = (IItemContainerGenerator)_itemContainerGenerator;
            using (generator.StartAt(pos, GeneratorDirection.Forward))
            {
                for (int i = 0; i < itemCount; i++)
                {
                    UIElement e = generator.GenerateNext() as UIElement;
                    if(e != null)
                    {
                        _uiElementCollection.InsertInternal(pos.Index + 1 + i, e);
                        generator.PrepareItemContainer(e);
                    }
                    else
                    {
                        _itemContainerGenerator.Verify();
                    }
                }
            }
        }
コード例 #2
0
 // This is internal as an optimization for VirtualizingStackPanel (so it doesn't need to re-query InternalChildren repeatedly)
 internal static void InsertInternalChild(UIElementCollection children, int index, UIElement child)
 {
     children.InsertInternal(index, child);
 }
コード例 #3
0
 // This is internal as an optimization for VirtualizingStackPanel (so it doesn't need to re-query InternalChildren repeatedly)
 internal static void InsertInternalChild(UIElementCollection children, int index, UIElement child)
 {
     children.InsertInternal(index, child);
 }