private static void OnIsOverflowOpenChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            if (!qat.IsOverflowOpen)
            {
                // If the overflow drop down is closed due to
                // an action of context menu then ContextMenuClosed
                // event is never raised. Hence reset the flag.
                qat.InContextMenu = false;
            }

            UIElement popupChild = qat._overflowPopup.TryGetChild();

            RibbonHelper.HandleIsDropDownChanged(
                qat,
                delegate() { return(qat.IsOverflowOpen); },
                popupChild,
                popupChild);

            if ((bool)(e.NewValue))
            {
                qat.RetainFocusOnEscape = RibbonHelper.IsKeyboardMostRecentInputDevice();
            }

            // Raise UI Automation Events
            RibbonQuickAccessToolBarAutomationPeer peer = UIElementAutomationPeer.FromElement(qat) as RibbonQuickAccessToolBarAutomationPeer;

            if (peer != null)
            {
                peer.RaiseExpandCollapseAutomationEvent(!(bool)e.OldValue, !(bool)e.NewValue);
            }
        }
        private static object OnCoerceIsOverflowOpen(DependencyObject d, object baseValue)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)d;

            if (!qat.HasOverflowItems)
            {
                return(false);
            }
            return(baseValue);
        }
        private static object OnCoerceDataContext(DependencyObject d, object baseValue)
        {
            if (baseValue == null)
            {
                RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)d;
                if (qat.Ribbon != null)
                {
                    return(qat.Ribbon.DataContext);
                }
            }

            return(baseValue);
        }
 public KeyTipAutoGenerationElements(RibbonQuickAccessToolBar quickAccessToolBar)
 {
     QuickAccessToolBar = quickAccessToolBar;
 }
        private static void OnContextMenuClosingThunk(object sender, ContextMenuEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            qat.OnContextMenuClosingInternal();
        }
        private static void OnMouseDownThunk(object sender, MouseButtonEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            qat.OnAnyMouseDown();
        }
        private static void OnDismissPopupThunk(object sender, RibbonDismissPopupEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            qat.OnDismissPopup(e);
        }
        private static void OnLostMouseCaptureThunk(object sender, MouseEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            qat.OnLostMouseCaptureThunk(e);
        }
        private static void OnClickThroughThunk(object sender, MouseButtonEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            qat.OnClickThrough(e);
        }
        private static void OnHasOverflowItemsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RibbonQuickAccessToolBar qat = (RibbonQuickAccessToolBar)sender;

            qat.CoerceValue(RibbonQuickAccessToolBar.IsOverflowOpenProperty);
        }