Esempio n. 1
0
        void FillTreeList(ObservableCollection <LiteTreeViewItemViewModel> items, IList <LiteTreeViewItemViewModel> children, ref int myIndex)
        {
            if (items == null)
            {
                return;
            }
            ContainerList = items;
            if (children != null && children.Any())
            {
                if (myIndex == -1)
                {
                    myIndex = items.IndexOf(this);
                }
                if (IsOpen)
                {
                    CollectionExtensions.InsertRange(items, myIndex + 1, children);

                    foreach (var child in children)
                    {
                        ++myIndex;
                        //items.Insert(myIndex, child);
                        child.FillTreeList(items, ref myIndex);
                    }
                }
            }
        }