Exemple #1
0
 protected void Edit_MouseEnter(object sender, MouseEventArgs e)
 {
     if (_lastAnnotationMouseOver != null && _lastAnnotationMouseOver != this)
     {
         Application.Current?.Dispatcher?.Invoke(() =>
         {
             if (_lastAnnotationMouseOver.ActionsAdorner != null)
             {
                 _lastAnnotationMouseOver.ActionsAdorner.Visibility = Visibility.Hidden;
             }
         });
         _lastAnnotationMouseOver.VisibilityTimer.Change(Timeout.Infinite, Timeout.Infinite);
         _lastAnnotationMouseOver.VisibilityTimer = null;
         _lastAnnotationMouseOver = null;
     }
     if (VisibilityTimer != null)
     {
         VisibilityTimer.Change(Timeout.Infinite, Timeout.Infinite);
         VisibilityTimer = null;
     }
     if (ActionsAdorner.Visibility == Visibility.Hidden)
     {
         _lastAnnotationMouseOver  = this;
         ActionsAdorner.Opacity    = 0.0;
         ActionsAdorner.Visibility = Visibility.Visible;
         ActionsAdorner.BeginAnimation(OpacityProperty, FadeIn);
     }
 }
Exemple #2
0
 void VisibilityTimerCallback(object state)
 {
     Application.Current?.Dispatcher?.Invoke(() =>
     {
         if (ActionsAdorner != null)
         {
             ActionsAdorner.Opacity = 1.0;
             ActionsAdorner.BeginAnimation(OpacityProperty, FadeOut);
             ActionsAdorner.Visibility = Visibility.Hidden;
         }
     });
     VisibilityTimer.Change(Timeout.Infinite, Timeout.Infinite);
     VisibilityTimer          = null;
     _lastAnnotationMouseOver = null;
 }