private List <ObjectViewModel> GetAllItems(ObjectViewModel ovm) { List <ObjectViewModel> results = new List <ObjectViewModel>(); foreach (var item in ovm.Children) { results.Add(item); results.AddRange(GetAllItems(item)); } return(results); }
public ObjectViewModel(ArchestrAObject obj, ObjectViewModel parent) { _object = obj; _parent = parent; Children = new ReadOnlyCollection <ObjectViewModel>((from child in _object.Children select new ObjectViewModel(child, this)).ToList()); }