void AddTreeViewItem(ItemCollection collection, TreeViewItemInfo info)
        {
            RichEditTreeViewItem item = new RichEditTreeViewItem(info);

            item.Header    = GetTreeViewItemHeader(info.Element, collection.Count + 1);
            item.Expanded += OnTreeViewItemExpanded;
            item.Selected += OnTreeViewItemSelected;
            collection.Add(item);
        }
 public RichEditTreeViewItem(TreeViewItemInfo info)
 {
     this.info = info;
     if (info.HasChildNodes)
     {
         Items.Add(new TreeViewItem()
         {
             Header = "Loading..."
         });
     }
 }
 public ChildElementsCollector(TreeViewItemInfo parentElement)
 {
     this.collection    = new List <TreeViewItemInfo>();
     this.parentElement = parentElement;
     Visit(ParentElement.Element);
 }