Esempio n. 1
0
        private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ToolTip t = (ToolTip)d;

            if ((bool)e.NewValue)
            {
                if (t._parentPopup == null)
                {
                    t.HookupParentPopup();
                }
            }
            else
            {
                // When ToolTip is about to close but still hooked up - we need to raise Accessibility event
                if (AutomationPeer.ListenerExists(AutomationEvents.ToolTipClosed))
                {
                    AutomationPeer peer = UIElementAutomationPeer.CreatePeerForElement(t);
                    if (peer != null)
                    {
                        peer.RaiseAutomationEvent(AutomationEvents.ToolTipClosed);
                    }
                }
            }

            OnVisualStatePropertyChanged(d, e);
        }
Esempio n. 2
0
        // Token: 0x06005872 RID: 22642 RVA: 0x00188288 File Offset: 0x00186488
        private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ToolTip toolTip = (ToolTip)d;

            if ((bool)e.NewValue)
            {
                if (toolTip._parentPopup == null)
                {
                    toolTip.HookupParentPopup();
                }
            }
            else if (AutomationPeer.ListenerExists(AutomationEvents.ToolTipClosed))
            {
                AutomationPeer automationPeer = UIElementAutomationPeer.CreatePeerForElement(toolTip);
                if (automationPeer != null)
                {
                    automationPeer.RaiseAutomationEvent(AutomationEvents.ToolTipClosed);
                }
            }
            Control.OnVisualStatePropertyChanged(d, e);
        }