Ejemplo n.º 1
0
        protected virtual void HandlePreviewTabKey(KeyEventArgs e)
        {
            if (e.Handled)
            {
                return;
            }

            var dataGridControl = this.ParentDataGridControl;

            if (dataGridControl == null)
            {
                return;
            }

            var dataGridContext = dataGridControl.CurrentContext;

            if (dataGridContext == null)
            {
                return;
            }

            var container = dataGridContext.GetContainerFromItem(dataGridContext.InternalCurrentItem);

            if (container == null)
            {
                return;
            }

            var tabbingMode = KeyboardNavigation.GetTabNavigation(container);

            if (tabbingMode == KeyboardNavigationMode.None)
            {
                return;
            }

            if ((Keyboard.Modifiers == ModifierKeys.None) || (Keyboard.Modifiers == ModifierKeys.Shift))
            {
                DataGridItemsHost.BringIntoViewKeyboardFocusedElement();

                //Force the "inline" relayout of the panel
                //This has no effect if the panel do not have to be updated.
                this.UpdateLayout();
            }
        }
Ejemplo n.º 2
0
 protected virtual void HandlePreviewDownKey(KeyEventArgs e)
 {
     DataGridItemsHost.BringIntoViewKeyboardFocusedElement();
     this.UpdateLayout();
 }