Beispiel #1
0
        /// <summary>
        ///     Property changed called back for IsSelected property
        /// </summary>
        private static void OnIsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RibbonTab ribbonTab = (RibbonTab)sender;

            if (ribbonTab.IsSelected)
            {
                ribbonTab.OnSelected(new RoutedEventArgs(Selector.SelectedEvent, ribbonTab));
            }
            else
            {
                ribbonTab.OnUnselected(new RoutedEventArgs(Selector.UnselectedEvent, ribbonTab));
            }
            RibbonTabHeader header = ribbonTab.RibbonTabHeader;

            if (header != null)
            {
                header.CoerceValue(RibbonTabHeader.IsRibbonTabSelectedProperty);
            }

            // Raise UI automation events on this RibbonTab
            if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected) ||
                AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection))
            {
                RibbonTabAutomationPeer peer = RibbonTabAutomationPeer.CreatePeerForElement(ribbonTab) as RibbonTabAutomationPeer;
                if (peer != null)
                {
                    peer.RaiseTabSelectionEvents();
                }
            }
        }
Beispiel #2
0
        private static void OnKeyTipChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonTab       tab       = (RibbonTab)d;
            RibbonTabHeader tabHeader = tab.RibbonTabHeader;

            if (tabHeader != null)
            {
                tabHeader.CoerceValue(KeyTipService.KeyTipProperty);
            }
        }
Beispiel #3
0
        /// <summary>
        ///     Property changed callback for IsEnabled property.
        /// <summary>
        private static void OnIsEnabledChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RibbonTab       ribbonTab = (RibbonTab)sender;
            RibbonTabHeader header    = ribbonTab.RibbonTabHeader;

            if (header != null)
            {
                header.CoerceValue(RibbonTabHeader.IsEnabledProperty);
            }
        }