Beispiel #1
0
        private static void OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RibbonSplitButton splitButton = (RibbonSplitButton)d;

            if (splitButton.IsCheckable)
            {
                RibbonSplitButtonAutomationPeer peer = UIElementAutomationPeer.FromElement(splitButton) as RibbonSplitButtonAutomationPeer;
                if (peer != null)
                {
                    peer.RaiseToggleStatePropertyChangedEvent((bool)e.OldValue, (bool)e.NewValue);
                }
            }
        }
Beispiel #2
0
        private void OnHeaderClicked(object sender, RoutedEventArgs e)
        {
            RaiseEvent(new RoutedEventArgs(RibbonSplitButton.ClickEvent, this));

            if (!IsCheckable && AutomationPeer.ListenerExists(AutomationEvents.InvokePatternOnInvoked))
            {
                RibbonSplitButtonAutomationPeer peer = UIElementAutomationPeer.FromElement(this) as RibbonSplitButtonAutomationPeer;
                if (peer != null)
                {
                    peer.RaiseInvokeAutomationEvent();
                }
            }
        }