/// <summary> /// Add child. Returns this instance (not child). /// </summary> public TuiView AddChild(TuiView child) { Children = Children ?? new List <TuiView>(); // TODO: should we worry about loop detection // or leave user to their own peril? child.Parent?.Children.Remove(child); child.Parent = this; Children.Add(child); return(this); }
public TuiView AddView(string type, string name = null) { var last = LastView; LastView = new TuiView { Builder = this, Type = type, Name = name, LocalName = LocalName(type, name), }; _views.Add(LastView); return(LastView); }