Beispiel #1
0
        public void SelectLast()
        {
            TreeViewExItem item = TreeViewElementFinder.FindLast(treeViewEx, true);

            if (item != null)
            {
                SelectSingleItem(item);
            }

            FocusHelper.Focus(item);
        }
        internal void StopEditing()
        {
            if (editedItem == null)
            {
                return;
            }

            Keyboard.Focus(editedItem);
            editedItem.IsEditing = false;
            FocusHelper.Focus(editedItem);
            editedItem = null;
        }
Beispiel #3
0
 public void SelectFromProperty(TreeViewExItem item, bool isSelected)
 {
     // we do not check if selection is allowed, because selecting on that way is no user action.
     // Hopefully the programmer knows what he does...
     if (isSelected)
     {
         treeViewEx.SelectedItems.Add(item.DataContext);
         lastShiftRoot = item.DataContext;
         FocusHelper.Focus(item);
     }
     else
     {
         treeViewEx.SelectedItems.Remove(item.DataContext);
     }
 }
Beispiel #4
0
        internal override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);

            // click
            if (selectItem != null && e.ChangedButton == selectButton)
            {
                // select item
                SelectSingleItem(selectItem);
                FocusHelper.Focus(selectItem);

                // end click
                selectItem = null;
            }
        }
Beispiel #5
0
        public void SelectNextFromKey()
        {
            TreeViewExItem item = GetFocusedItem();

            item = TreeViewElementFinder.FindNext(item, true);
            if (item == null)
            {
                return;
            }

            // if ctrl is pressed just focus it, so it can be selected by space. Otherwise select it.
            if (!IsControlKeyDown)
            {
                SelectSingleItem(item);
            }

            FocusHelper.Focus(item);
        }
Beispiel #6
0
        public void SelectPreviousFromKey()
        {
            List <TreeViewExItem> items = TreeViewElementFinder.FindAll(treeViewEx, true).ToList();
            TreeViewExItem        item  = GetFocusedItem();

            item = treeViewEx.GetPreviousItem(item, items);
            if (item == null)
            {
                return;
            }

            // if ctrl is pressed just focus it, so it can be selected by space. Otherwise select it.
            if (!IsControlKeyDown)
            {
                SelectSingleItem(item);
            }

            FocusHelper.Focus(item);
        }
Beispiel #7
0
        public void SelectFromUiAutomation(TreeViewExItem item)
        {
            SelectSingleItem(item);

            FocusHelper.Focus(item);
        }