Пример #1
0
        private static void DisposeTooltip()
        {
            if (s_popup != null)
            {
                // Clear the ToolTip's Content in case it has control content: this will
                // reset its visual parent allowing it to be used again.
                ((ToolTip)s_popup.Content).Content = null;

                // Dispose of the popup.
                s_popup.Dispose();
                s_popup = null;
            }
        }
Пример #2
0
        /// <summary>
        /// Called when the pointer leaves a control with an attached tooltip.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event args.</param>
        private static void ControlPointerLeave(object sender, PointerEventArgs e)
        {
            var control = (Control)sender;

            if (control == s_current)
            {
                if (s_popup != null)
                {
                    // Clear the ToolTip's Content in case it has control content: this will
                    // reset its visual parent allowing it to be used again.
                    ((ToolTip)s_popup.Content).Content = null;

                    // Dispose of the popup.
                    s_popup.Dispose();
                    s_popup = null;
                }

                s_show.OnNext(null);
            }
        }