Пример #1
0
 /// <summary>
 /// 取消所有子节点的选中
 /// </summary>
 public void UnSelectAllChildren()
 {
     if (Items != null && Items.Count > 0)
     {
         foreach (var item in Items)
         {
             if (item is MultiSelectionTreeViewItem)
             {
                 (item as MultiSelectionTreeViewItem).UnSelectAllChildren();
             }
             else
             {
                 MultiSelectionTreeViewItem tvi = this.ItemContainerGenerator.ContainerFromItem(item) as MultiSelectionTreeViewItem;
                 if (tvi != null)
                 {
                     tvi.UnSelectAllChildren();
                 }
             }
         }
     }
     if (IsSelected != false)
     {
         IsSelected = false;
     }
     //TODO:
     ParentTreeView.OnSelectionChnanged(this);
 }
 private void UnSelectAll()
 {
     if (Items != null && Items.Count > 0)
     {
         foreach (var item in Items)
         {
             if (item is MultiSelectionTreeViewItem)
             {
                 (item as MultiSelectionTreeViewItem).UnSelectAllChildren();
             }
             else
             {
                 MultiSelectionTreeViewItem tvi = this.ItemContainerGenerator.ContainerFromItem(item) as MultiSelectionTreeViewItem;
                 if (tvi != null)
                 {
                     tvi.UnSelectAllChildren();
                 }
             }
         }
     }
 }