Ejemplo n.º 1
0
 public static DoubleAnimation CreateDouble(double? to, Duration duration, string targetProperty)
 {
     var animation = new DoubleAnimation
     {
         To = to,
         Duration = duration,
         EnableDependentAnimation = true
     };
     Storyboard.SetTargetProperty(animation, targetProperty);
     return animation;
 }
Ejemplo n.º 2
0
 public static void BeginDoubleAnimation(this DependencyObject target, string path, double? to,
     Duration duration)
 {
     var animation = new DoubleAnimation
     {
         To = to,
         Duration = duration,
         EnableDependentAnimation = true
     };
     target.BeginAnimation(animation, path);
 }
Ejemplo n.º 3
0
 public static ColorAnimation CreateColor(Color to, Duration duration, string targetProperty)
 {
     var animation = new ColorAnimation
     {
         To = to,
         Duration = duration,
         EnableDependentAnimation = true
     };
     Storyboard.SetTargetProperty(animation, targetProperty);
     return animation;
 }
Ejemplo n.º 4
0
 public static void CreateCanvasStoryBoardAndBegin(this DependencyObject target, double? toX, double? toY, Duration duration)
 {
     var xAnimation = CreateDouble(toX, duration, "(Canvas.Left)");
     var yAnimation = CreateDouble(toY, duration, "(Canvas.Top)");
     CreateStoryBoardAndBegin(target, xAnimation, yAnimation);
 }
Ejemplo n.º 5
0
 public static void BeginPointAnimation(this DependencyObject target, string path, Point to, Duration duration)
 {
     var animation = CreatePoint(to, duration, path);
     target.BeginAnimation(animation, path);
 }
Ejemplo n.º 6
0
 public static void BeginColorAnimation(this DependencyObject target, string path, Color to, Duration duration)
 {
     var animation = CreateColor(to, duration, path);
     target.BeginAnimation(animation, path);
 }
Ejemplo n.º 7
0
 public static void CreateY1Y2StoryBoardAndBegin(this DependencyObject target, double? toY1, double? toY2,
     Duration duration)
 {
     var y1Animation = CreateDouble(toY1, duration, nameof(Line.Y1));
     var y2Animation = CreateDouble(toY2, duration, nameof(Line.Y2));
     CreateStoryBoardAndBegin(target, y1Animation, y2Animation);
 }
Ejemplo n.º 8
0
 public static PointAnimation CreatePoint(Point from, Point to, Duration duration, string targetProperty)
 {
     var animation = new PointAnimation
     {
         From = from,
         To = to,
         Duration = duration
     };
     Storyboard.SetTargetProperty(animation, targetProperty);
     return animation;
 }