Exemple #1
0
            private void StartTimer()
            {
                this.StopTimer();
                TimeSpan mouseHoverDelay = MouseHover.GetMouseHoverDelay(this.Element);

                this.Timer = new DispatcherTimer(mouseHoverDelay, DispatcherPriority.Input, new EventHandler(this.OnTimerTick), this.Element.Dispatcher);
            }
Exemple #2
0
 private static void DetachHoverMonitor(UIElement element)
 {
     MouseHover.Monitor mouseHoverMonitor = MouseHover.GetMouseHoverMonitor(element);
     if (mouseHoverMonitor != null)
     {
         mouseHoverMonitor.Dispose();
         MouseHover.SetMouseHoverMonitor(element, null);
     }
 }
Exemple #3
0
        private static void OnIsMouseHoverTrackingEnabledChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            UIElement uIElement = obj as UIElement;

            if (uIElement == null)
            {
                throw new ArgumentException("MouseHover element must be a UIElement.");
            }
            if ((bool)args.NewValue)
            {
                MouseHover.AttachHoverMonitor(uIElement);
                return;
            }
            MouseHover.DetachHoverMonitor(uIElement);
        }
Exemple #4
0
 private static void AttachHoverMonitor(UIElement element)
 {
     MouseHover.DetachHoverMonitor(element);
     MouseHover.SetMouseHoverMonitor(element, new MouseHover.Monitor(element));
 }