Exemplo n.º 1
0
 private void GridContent_MouseLeave(object sender, MouseEventArgs e)
 {
     if (Config.HoverEnabled)
     {
         var anim = new DoubleAnimation(0, new Duration(TimeSpan.FromMilliseconds(Config.HoverHideDelay)));
         Hover.BeginAnimation(OpacityProperty, anim);
     }
 }
Exemplo n.º 2
0
 public void MoveHover(GridIconControl icon)
 {
     if (Config.HoverEnabled)
     {
         if (Hover.Opacity == 0)
         {
             var anim = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromMilliseconds(Config.HoverPopupDelay)));
             Hover.BeginAnimation(OpacityProperty, anim);
         }
         else
         {
             Hover.BeginAnimation(OpacityProperty, null);
             Hover.Opacity = 1;
         }
         var bounds = icon.TransformToAncestor(wpContent).TransformBounds(new Rect(0, 0, icon.ActualWidth, icon.ActualHeight));
         var anim2  = new ThicknessAnimation(Hover.Margin, new Thickness(bounds.Left - 3, bounds.Top - 3, 0, 0), new Duration(TimeSpan.FromMilliseconds(Config.HoverMoveDealy)));
         anim2.AccelerationRatio = 0.2;
         Hover.BeginAnimation(MarginProperty, null);
         Hover.BeginAnimation(MarginProperty, anim2);
     }
 }