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; }
private void ChildRemoved(VisualNode node, int index) { node.Parent = null; }
private void ChildAdded(VisualNode node, int index) { node.Parent = this; }
public VisualTree(VisualNode root) { Root = root ?? throw new ArgumentNullException(nameof(root)); }