Ejemplo n.º 1
0
        private bool HandleUpDownKey(bool up, KeyEventArgs e)
        {
            FocusNavigationDirection direction = (up ? FocusNavigationDirection.Up : FocusNavigationDirection.Down);

            if (AllowHandleKeyEvent(direction))
            {
                TreeView      treeView      = ParentTreeView;
                IInputElement originalFocus = Keyboard.FocusedElement;
                if (treeView != null)
                {
                    FrameworkElement startingContainer = this.HeaderElement;
                    if (startingContainer == null)
                    {
                        startingContainer = this;
                    }
                    ItemsControl parentItemsControl = ItemsControl.ItemsControlFromItemContainer(this);
                    ItemInfo     startingInfo       = (parentItemsControl != null)
                        ? parentItemsControl.ItemInfoFromContainer(this)
                        : null;

                    return(treeView.NavigateByLine(
                               startingInfo,
                               startingContainer,
                               direction,
                               new ItemNavigateArgs(e.Device, Keyboard.Modifiers)));
                }
            }

            return(false); // Not handled
        }
        // Token: 0x06005924 RID: 22820 RVA: 0x0018A270 File Offset: 0x00188470
        private bool HandleUpDownKey(bool up, KeyEventArgs e)
        {
            FocusNavigationDirection direction = up ? FocusNavigationDirection.Up : FocusNavigationDirection.Down;

            if (this.AllowHandleKeyEvent(direction))
            {
                TreeView      parentTreeView = this.ParentTreeView;
                IInputElement focusedElement = Keyboard.FocusedElement;
                if (parentTreeView != null)
                {
                    FrameworkElement frameworkElement = this.HeaderElement;
                    if (frameworkElement == null)
                    {
                        frameworkElement = this;
                    }
                    ItemsControl          itemsControl = ItemsControl.ItemsControlFromItemContainer(this);
                    ItemsControl.ItemInfo startingInfo = (itemsControl != null) ? itemsControl.ItemInfoFromContainer(this) : null;
                    return(parentTreeView.NavigateByLine(startingInfo, frameworkElement, direction, new ItemsControl.ItemNavigateArgs(e.Device, Keyboard.Modifiers)));
                }
            }
            return(false);
        }