private TreeNodeViewModel PrevVisibleSibling()
        {
            var _parent = this.Parent;

            if (_parent != null)
            {
                TreeNodeViewModel result = null;
                for (int i = 0; i < _parent.Items.Count && i < this.Index; i++)
                {
                    var current = _parent.Items[i];
                    if (current.IsVisible)
                    {
                        result = current;
                    }
                }
                if (result != null)
                {
                    return(result);
                }
                else
                {
                    return(this.Parent.PrevVisibleSibling());
                }
            }
            else
            {
                var _rootParent = GetRootParent();
                if (_rootParent != null)
                {
                    for (int i = 0; i < _rootParent.Items.Count && i < this.Index; i++)
                    {
                        var current = _rootParent.Items[i];
                        if (current.IsVisible)
                        {
                            return(current);
                        }
                    }
                    return(null);
                }
                else
                {
                    return(null);
                }
            }
        }
        private TreeNodeViewModel LastVisibleChild()
        {
            TreeNodeViewModel result = null;

            for (int i = 0; i < this.Items.Count; i++)
            {
                var current = this.Items[i];
                if (current.IsVisible)
                {
                    result = current;
                }
                else
                {
                    this.Items[i].NextVisibleChild();
                }
            }
            return(result);
        }
 public TreeNodeViewModel Add(TreeNodeViewModel node)
 {
     return(Add(node.Name, node.Text, node.ImageIndex));
 }
 public TreeNodeViewModel Add(TreeNodeViewModel node)
 {
     return(Add(node.Name, node.Text));
 }