Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="TreeView"></param>
 /// <param name="TreeViewItem"></param>
 public static void SelectItemsRandomly(this TreeView TreeView, TreeViewItem TreeViewItem)
 {
     TreeViewItemExtensions.SetIsSelected(TreeViewItem, !TreeViewItemExtensions.GetIsSelected(TreeViewItem));
     if (TreeViewExtensions.GetStartItem(TreeView) == null || Keyboard.Modifiers == ModifierKeys.Control)
     {
         if (TreeViewItemExtensions.GetIsSelected(TreeViewItem))
         {
             TreeViewExtensions.SetStartItem(TreeView, TreeViewItem);
         }
     }
     else
     {
         if (TreeViewExtensions.GetSelectedItems(TreeView).Count == 0)
         {
             TreeViewExtensions.SetStartItem(TreeView, null);
         }
     }
 }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="TreeView"></param>
 /// <param name="Item"></param>
 public static void SelectItem(this TreeView TreeView, TreeViewItem Item)
 {
     SelectNone(TreeView);
     TreeViewItemExtensions.SetIsSelected(Item, true);
     TreeViewExtensions.SetStartItem(TreeView, Item);
 }