Пример #1
0
 void ClearSubItems(TreeItemModel top)
 {
     top.Children.ForEach(delegate(TreeItemModel item) {
         item.IsEffectiveItem = false;
         ClearSubItems(item);
     });
 }
Пример #2
0
 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);
             });
         }
     }
 }