void ClearSubItems(TreeItemModel top) { top.Children.ForEach(delegate(TreeItemModel item) { item.IsEffectiveItem = false; ClearSubItems(item); }); }
void InitSubItems(TreeItemModel top) { if (top.IsChecked == true) { top.IsEffectiveItem = true; if (!top.Children.Any()) { top.IsLeaf = true; } ClearSubItems(top); } else { top.IsEffectiveItem = false; if (top.Children.Any()) { top.Children.ForEach(delegate(TreeItemModel item) { InitSubItems(item); }); } } }