private void addChildItem(IReadOnlyList <Person> childs, PersonItem parent = null) { foreach (var child in childs) { var citem = new PersonItem(child, parent); parent?.AddChild(citem); PeopleItems.Add(citem); addChildItem(child.Childs, citem); } }
public void AddChild(PersonItem child) { childs.Add(child); }