/// < summary >
 /// Remove child
 /// </ summary >
 public void RemoveChild(GameSimParametersTreeElement child)
 {
     if (Children.Contains(child))
     {
         Children.Remove(child);
         child.Parent = null;
     }
 }
 /// < summary >
 /// Add a child
 /// </ summary >
 public void AddChild(GameSimParametersTreeElement child)
 {
     if (child.Parent != null)
     {
         child.Parent.RemoveChild(child);
     }
     Children.Add(child);
     child.Parent = this;
 }
 private void AddChildrenRecursive(GameSimParametersTreeElement element, TreeViewItem item, IList <TreeViewItem> rows)
 {
     foreach (var childElement in element.Children)
     {
         var childItem = CreateTreeViewItem(childElement);
         item.AddChild(childItem);
         rows.Add(childItem);
         if (childElement.Children.Count >= 1)
         {
             childItem.children = CreateChildListForCollapsedParent();
         }
     }
 }
 private GameSimParametersTreeviewItem CreateTreeViewItem(GameSimParametersTreeElement model)
 {
     return(new GameSimParametersTreeviewItem {
         id = model.Id, displayName = model.Name, Data = model
     });
 }