예제 #1
0
        internal virtual void MergeWith(VisualNode newNode)
        {
            if (newNode == this)
            {
                return;
            }

            for (int i = 0; i < Children.Count; i++)
            {
                if (newNode.Children.Count > i)
                {
                    Children[i].MergeWith(newNode.Children[i]);
                }
            }

            for (int i = newNode.Children.Count; i < Children.Count; i++)
            {
                Children[i].OnUnmount();
                Children[i].Parent = null;
            }

            Parent = null;
        }
예제 #2
0
 private void ChildRemoved(VisualNode node, int index)
 {
     node.Parent = null;
 }
예제 #3
0
 private void ChildAdded(VisualNode node, int index)
 {
     node.Parent = this;
 }
예제 #4
0
 public VisualTree(VisualNode root)
 {
     Root = root ?? throw new ArgumentNullException(nameof(root));
 }