Microsoft.Windows.Controls.Ribbon.RibbonMenuButton.OnGotKeyboardFocus C# (CSharp) Метод

OnGotKeyboardFocus() защищенный Метод

protected OnGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
e System.Windows.Input.KeyboardFocusChangedEventArgs
Результат void
        protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
        {
            base.OnGotKeyboardFocus(e);

            FrameworkElement currentSelection = CurrentSelection;
            if (currentSelection != null &&
                IsDropDownOpen)
            {
                UIElement popupChild = _popup.TryGetChild();
                if (popupChild != null &&
                    !popupChild.IsKeyboardFocusWithin)
                {
                    // If the drop down is open and the currentselection is valid
                    // but still popup doesnt have focus within,
                    // then focus the current selection.
                    currentSelection.Focus();
                }
            }
        }