예제 #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
        }
예제 #2
0
        // Token: 0x060058EA RID: 22762 RVA: 0x00189810 File Offset: 0x00187A10
        private bool HandleScrollByPage(KeyEventArgs e)
        {
            IInputElement focusedElement = Keyboard.FocusedElement;
            ItemsControl  itemsControl   = ItemsControl.ItemsControlFromItemContainer(this._selectedContainer);

            ItemsControl.ItemInfo startingInfo     = (itemsControl != null) ? itemsControl.ItemInfoFromContainer(this._selectedContainer) : null;
            FrameworkElement      frameworkElement = this._selectedContainer.HeaderElement;

            if (frameworkElement == null)
            {
                frameworkElement = this._selectedContainer;
            }
            return(base.NavigateByPage(startingInfo, frameworkElement, (e.Key == Key.Prior) ? FocusNavigationDirection.Up : FocusNavigationDirection.Down, new ItemsControl.ItemNavigateArgs(e.Device, Keyboard.Modifiers)));
        }
예제 #3
0
파일: TreeView.cs 프로젝트: ash2005/z
        private bool HandleScrollByPage(KeyEventArgs e)
        {
            IInputElement originalFocusedElement = Keyboard.FocusedElement;
            ItemsControl  parentItemsControl     = ItemsControl.ItemsControlFromItemContainer(_selectedContainer);
            ItemInfo      startingInfo           = (parentItemsControl != null)
                ? parentItemsControl.ItemInfoFromContainer(_selectedContainer)
                : null;

            FrameworkElement startingContainer = _selectedContainer.HeaderElement;

            if (startingContainer == null)
            {
                startingContainer = _selectedContainer;
            }

            return(NavigateByPage(startingInfo,
                                  startingContainer,
                                  (e.Key == Key.PageUp ? FocusNavigationDirection.Up : FocusNavigationDirection.Down),
                                  new ItemNavigateArgs(e.Device, Keyboard.Modifiers)));
        }
        // 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);
        }