using System.Collections.ObjectModel; using System.Linq; namespace PRSDesktop { public class OrgChartEntries : ObservableCollection { public bool IsChildOf(OrgChartEntry child, OrgChartEntry parent) { if (child == null) return false; if (parent == null) return false; if (parent == child) return true; return IsChildOf(this.FirstOrDefault(x => x.ID == child.ParentID), parent); } } }