/// <summary>
        /// The on element mouse leave.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private static void OnElementMouseLeave(object sender, MouseEventArgs e)
        {
            PinnableToolTip toolTip = null;

            lock (Locker)
            {
                var currentElement = (UIElement)sender;
                if (ElementsAndToolTips.ContainsKey(currentElement))
                {
                    toolTip = ElementsAndToolTips[currentElement];
                }
                else
                {
                    return;
                }
            }

            if (toolTip == null)
            {
                return;
            }

            if (!toolTip.IsOpen)
            {
                toolTip.StopTimer();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// The on control enabled changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private static void OnControlEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if ((bool)e.NewValue)
            {
                return;
            }

            var             element = (UIElement)sender;
            PinnableToolTip toolTip = null;

            lock (Locker)
            {
                if (ElementsAndToolTips.ContainsKey(element))
                {
                    toolTip = ElementsAndToolTips[element];
                }
            }

            toolTip?.StopTimer();
        }