private ItemTreeModel GetModel(List<ItemTreeModel> list, string Header) { foreach (var item in list) { if (item == null) continue; else if (item.ItemHeader == Header) return item; else if (item.ItemParent.Count > 0) { ItemTreeModel model = GetModel(item.ItemParent, Header); if (model.Header != null) return model; } } return null; }