public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0, 1)),

                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration, 1),

                element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, transform.TranslateX - 700)
                    .AddEasingKeyFrame(Duration*0.6, transform.TranslateX + 30, new QuadraticEase())
                    .AddEasingKeyFrame(Duration*0.8, transform.TranslateX),

                element.AnimateProperty(AnimationProperty.SkewX)
                    .AddEasingKeyFrame(0.0, 30)
                    .AddEasingKeyFrame(Duration*0.6, -30)
                    .AddEasingKeyFrame(Duration*0.8, 15)
                    .AddEasingKeyFrame(Duration, 0),
            };
        }
Exemple #2
0
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.RotationY)
         .AddEasingKeyFrame(0.0, 0)
         .AddEasingKeyFrame(Duration * 0.4, 170)
         .AddEasingKeyFrame(Duration * 0.5, 190)
         .AddEasingKeyFrame(Duration * 0.8, 360)
         .AddEasingKeyFrame(Duration, 360),
         element.AnimateProperty(AnimationProperty.GlobalOffsetZ)
         .AddEasingKeyFrame(0.0, 0)
         .AddEasingKeyFrame(Duration * 0.4, 150)
         .AddEasingKeyFrame(Duration * 0.5, 150)
         .AddEasingKeyFrame(Duration * 0.8, 0)
         .AddEasingKeyFrame(Duration, 0),
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration * 0.5, 1)
         .AddEasingKeyFrame(Duration * 0.8, 1.1)
         .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration * 0.5, 1)
         .AddEasingKeyFrame(Duration * 0.8, 1.1)
         .AddEasingKeyFrame(Duration, 1),
     });
 }
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var animations = new List <Timeline>();

            if (Math.Abs(DistanceY) > 0.001)
            {
                animations.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(0.0, transform.TranslateY)
                    .AddEasingKeyFrame(Duration * 0.2, transform.TranslateY)
                    .AddEasingKeyFrame(Duration * 0.4, transform.TranslateY + DistanceY)
                    .AddEasingKeyFrame(Duration * 0.5, transform.TranslateY)
                    .AddEasingKeyFrame(Duration * 0.6, transform.TranslateY + (DistanceY / 2))
                    .AddEasingKeyFrame(Duration * 0.8, transform.TranslateY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY)
                    );
            }
            if (Math.Abs(DistanceX) > 0.001)
            {
                animations.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, transform.TranslateX)
                    .AddEasingKeyFrame(Duration * 0.2, transform.TranslateX)
                    .AddEasingKeyFrame(Duration * 0.4, transform.TranslateX + DistanceX)
                    .AddEasingKeyFrame(Duration * 0.5, transform.TranslateX)
                    .AddEasingKeyFrame(Duration * 0.6, transform.TranslateX + (DistanceX / 2))
                    .AddEasingKeyFrame(Duration * 0.8, transform.TranslateX)
                    .AddEasingKeyFrame(Duration, transform.TranslateX)
                    );
            }
            return(animations);
        }
Exemple #4
0
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var list = new List <Timeline>
            {
                element.AnimateProperty(AnimationProperty.CentreOfRotationY)
                .AddDiscreteKeyFrame(0.0, Centre),
                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration, 1, new CubicEase())
            };

            if (Reverse)
            {
                list.Add(element.AnimateProperty(AnimationProperty.RotationX)
                         .AddEasingKeyFrame(0.0, -90)
                         .AddEasingKeyFrame(Duration * 0.4, 10)
                         .AddEasingKeyFrame(Duration * 0.7, -10)
                         .AddEasingKeyFrame(Duration, 0));
            }
            else
            {
                list.Add(element.AnimateProperty(AnimationProperty.RotationX)
                         .AddEasingKeyFrame(0.0, 90)
                         .AddEasingKeyFrame(Duration * 0.4, -10)
                         .AddEasingKeyFrame(Duration * 0.7, 10)
                         .AddEasingKeyFrame(Duration, 0));
            }
            return(list);
        }
Exemple #5
0
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var list = new List <Timeline>
            {
                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 1)
                .AddEasingKeyFrame(Duration, 0),
            };

            if (Math.Abs(DistanceX) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, transform.TranslateX)
                    .AddEasingKeyFrame(Duration, transform.TranslateX + DistanceX));
            }
            if (Math.Abs(DistanceY) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(0.0, transform.TranslateY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY + DistanceY));
            }

            return(list);
        }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration * 0.1, MinScale)
         .AddEasingKeyFrame(Duration * 0.2, MinScale)
         .AddEasingKeyFrame(Duration * 0.3, MaxScale)
         .AddEasingKeyFrame(Duration * 0.9, MaxScale)
         .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration * 0.1, MinScale)
         .AddEasingKeyFrame(Duration * 0.2, MinScale)
         .AddEasingKeyFrame(Duration * 0.3, MaxScale)
         .AddEasingKeyFrame(Duration * 0.9, MaxScale)
         .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.Rotation)
         .AddEasingKeyFrame(Duration * 0.1, -3)
         .AddEasingKeyFrame(Duration * 0.2, -3)
         .AddEasingKeyFrame(Duration * 0.3, 3)
         .AddEasingKeyFrame(Duration * 0.4, -3)
         .AddEasingKeyFrame(Duration * 0.5, 3)
         .AddEasingKeyFrame(Duration * 0.6, -3)
         .AddEasingKeyFrame(Duration * 0.7, 3)
         .AddEasingKeyFrame(Duration * 0.8, -3)
         .AddEasingKeyFrame(Duration * 0.9, 3)
         .AddEasingKeyFrame(Duration, 0),
     });
 }
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
#if NETFX_CORE || WINDOWS_81_PORTABLE
            var frame = Window.Current.Content as Frame;
            var width = (frame != null) ? frame.ActualWidth : 1024;
#elif WINDOWS_PHONE
            var frame = Application.Current.RootVisual as PhoneApplicationFrame;
            var width = (frame != null) ? frame.ActualWidth : 250;
#endif

            return(new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                .AddDiscreteKeyFrame(0.0, new Point(0.0, 0.5)),
                element.AnimateProperty(AnimationProperty.ScaleX)
                .AddEasingKeyFrame(0.0, 1.0)
                .AddEasingKeyFrame(Duration / 2, JumpUp ? 0.95 : 1.05)
                .AddEasingKeyFrame(Duration, 1, new CubicEase()),
                element.AnimateProperty(AnimationProperty.ScaleY)
                .AddEasingKeyFrame(0.0, 1.0)
                .AddEasingKeyFrame(Duration / 2, JumpUp ? 0.95 : 1.05)
                .AddEasingKeyFrame(Duration, 1, new CubicEase()),

                element.AnimateProperty(AnimationProperty.TranslateX)
                .AddEasingKeyFrame(0.0, width)
                .AddEasingKeyFrame(Duration, 0, new CubicEase()),
                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration / 4, 1),
            });
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var animations = new List<Timeline>();
            if (Math.Abs(DistanceY) > 0.001)
                animations.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                        .AddEasingKeyFrame(0.0, transform.TranslateY)
                        .AddEasingKeyFrame(Duration * 0.2, transform.TranslateY)
                        .AddEasingKeyFrame(Duration * 0.4, transform.TranslateY + DistanceY)
                        .AddEasingKeyFrame(Duration * 0.5, transform.TranslateY)
                        .AddEasingKeyFrame(Duration * 0.6, transform.TranslateY + (DistanceY / 2))
                        .AddEasingKeyFrame(Duration * 0.8, transform.TranslateY)
                        .AddEasingKeyFrame(Duration, transform.TranslateY)
                    );
            if (Math.Abs(DistanceX) > 0.001)
                animations.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                        .AddEasingKeyFrame(0.0, transform.TranslateX)
                        .AddEasingKeyFrame(Duration * 0.2, transform.TranslateX)
                        .AddEasingKeyFrame(Duration * 0.4, transform.TranslateX + DistanceX)
                        .AddEasingKeyFrame(Duration * 0.5, transform.TranslateX)
                        .AddEasingKeyFrame(Duration * 0.6, transform.TranslateX + (DistanceX / 2))
                        .AddEasingKeyFrame(Duration * 0.8, transform.TranslateX)
                        .AddEasingKeyFrame(Duration, transform.TranslateX)
                    );
            return animations;
        }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, 1, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
         .AddEasingKeyFrame(Duration / 2, MaxScale, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
         .AddEasingKeyFrame(Duration, 1, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         }),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
         .AddEasingKeyFrame(Duration / 2, MaxScale, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
         .AddEasingKeyFrame(Duration, 1, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
     });
 }
Exemple #10
0
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            return(new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                .AddDiscreteKeyFrame(0.0, new Point(0, 1)),

                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration, 1),

                element.AnimateProperty(AnimationProperty.TranslateX)
                .AddEasingKeyFrame(0.0, transform.TranslateX - 700)
                .AddEasingKeyFrame(Duration * 0.6, transform.TranslateX + 30, new QuadraticEase())
                .AddEasingKeyFrame(Duration * 0.8, transform.TranslateX),

                element.AnimateProperty(AnimationProperty.SkewX)
                .AddEasingKeyFrame(0.0, 30)
                .AddEasingKeyFrame(Duration * 0.6, -30)
                .AddEasingKeyFrame(Duration * 0.8, 15)
                .AddEasingKeyFrame(Duration, 0),
            });
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var list = new List<Timeline>();

            if (RotateDirection == RotateAnimationDirection.RotateUp)
            {
                list.Add(element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.0, 1.5)));
                list.Add(element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(0.0, 45)
                    .AddEasingKeyFrame(Duration, 0.0, new QuadraticEase()));
            }
            else
            {
                list.Add(element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.0, -0.5)));
                list.Add(element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(0.0, -45)
                    .AddEasingKeyFrame(Duration, 0.0, new QuadraticEase()));
            }
            list.Add(element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration/4, 1, new QuadraticEase())
                .AddEasingKeyFrame(Duration, 1));

            return list;
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var list = new List<Timeline>
            {
                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration, 1),
            };
            if (Math.Abs(DistanceX) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                        .AddEasingKeyFrame(0.0, transform.TranslateX + DistanceX)
                        .AddEasingKeyFrame(Duration, transform.TranslateX, new CubicEase()));
            }
            if (Math.Abs(DistanceY) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                        .AddEasingKeyFrame(0.0, transform.TranslateY + DistanceY)
                        .AddEasingKeyFrame(Duration, transform.TranslateY, new CubicEase()));
            }

            return list;
        }
Exemple #13
0
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.Rotation).AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
         element.AnimateProperty(AnimationProperty.RotationX).AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
         element.AnimateProperty(AnimationProperty.RotationY).AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
     });
 }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.Opacity)
         .AddDiscreteKeyFrame(0.0, 1),
         element.AnimateProperty(AnimationProperty.Rotation)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.TranslateX)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.TranslateY)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddDiscreteKeyFrame(0.0, 1),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddDiscreteKeyFrame(0.0, 1),
         element.AnimateProperty(AnimationProperty.RotationX)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.RotationY)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.RotationZ)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
         .AddDiscreteKeyFrame(0.0, new Point(0.5, 0.5)),
     });
 }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.Opacity)
             .AddDiscreteKeyFrame(0.0, 1),
         element.AnimateProperty(AnimationProperty.Rotation)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.TranslateX)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.TranslateY)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.ScaleX)
             .AddDiscreteKeyFrame(0.0, 1),
         element.AnimateProperty(AnimationProperty.ScaleY)
             .AddDiscreteKeyFrame(0.0, 1),
         element.AnimateProperty(AnimationProperty.RotationX)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.RotationY)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.RotationZ)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
             .AddDiscreteKeyFrame(0.0, new Point(0.5, 0.5)),
     };
 }
 private static IEnumerable <Timeline> SkewToAnimation(this FrameworkElement element,
                                                       double seconds, Point skew, EasingFunctionBase easingFunction = null)
 {
     return(new Timeline[]
     {
         element.AnimateProperty("(UIElement.RenderTransform).(CompositeTransformation.SkewX)")
         .AddEasingKeyFrame(seconds, skew.X, easingFunction),
         element.AnimateProperty("(UIElement.RenderTransform).(CompositeTransformation.SkewY)")
         .AddEasingKeyFrame(seconds, skew.Y, easingFunction)
     });
 }
Exemple #17
0
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(Duration, FinalScale, new CubicEase {
         }),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration, FinalScale, new CubicEase {
         })
     });
 }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.CentreOfRotationX)
             .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.RotationY)
             .AddEasingKeyFrame(0, 80)
             .AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
         element.AnimateProperty(AnimationProperty.Opacity)
             .AddEasingKeyFrame(0.0, 1),
     };
 }
Exemple #19
0
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var list = new List <Timeline>
            {
                element.AnimateProperty(AnimationProperty.CentreOfRotationX)
                .AddDiscreteKeyFrame(0.0, Centre),
                element.AnimateProperty(AnimationProperty.RotationY)
                .AddEasingKeyFrame(0.0, From)
                .AddEasingKeyFrame(Duration, To, new QuadraticEase())
            };

            return(list);
        }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.CentreOfRotationX)
         .AddDiscreteKeyFrame(0.0, 0),
         element.AnimateProperty(AnimationProperty.RotationY)
         .AddEasingKeyFrame(0, 80)
         .AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
         element.AnimateProperty(AnimationProperty.Opacity)
         .AddEasingKeyFrame(0.0, 1),
     });
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            if (Side == Side.Left)
                return new Timeline[]
                {
                    element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                        .AddDiscreteKeyFrame(0.0, new Point(0,0)),

                    element.AnimateProperty(AnimationProperty.Rotation)
                        .AddEasingKeyFrame(0.0, 0, new CubicEase {EasingMode = EasingMode.EaseInOut})
                        .AddEasingKeyFrame(Duration*0.2, 80, new CubicEase {EasingMode = EasingMode.EaseInOut})
                        .AddEasingKeyFrame(Duration*0.4, 60, new CubicEase {EasingMode = EasingMode.EaseInOut})
                        .AddEasingKeyFrame(Duration*0.6, 80, new CubicEase {EasingMode = EasingMode.EaseInOut})
                        .AddEasingKeyFrame(Duration*0.8, 60, new CubicEase {EasingMode = EasingMode.EaseInOut})
                        .AddEasingKeyFrame(Duration, 70),

                    element.AnimateProperty(AnimationProperty.TranslateY)
                        .AddEasingKeyFrame(Duration*0.7, transform.TranslateY)
                        .AddEasingKeyFrame(Duration, transform.TranslateY + Distance, new CubicEase { EasingMode = EasingMode.EaseIn}),

                    element.AnimateProperty(AnimationProperty.Opacity)
                        .AddEasingKeyFrame(0.0, 1)
                        .AddEasingKeyFrame(Duration*0.9, 1)
                        .AddEasingKeyFrame(Duration, 0),
                };
            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(1,0)),

                element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(0.0, 0, new CubicEase {EasingMode = EasingMode.EaseInOut})
                    .AddEasingKeyFrame(Duration*0.2, -80, new CubicEase {EasingMode = EasingMode.EaseInOut})
                    .AddEasingKeyFrame(Duration*0.4, -60, new CubicEase {EasingMode = EasingMode.EaseInOut})
                    .AddEasingKeyFrame(Duration*0.6, -80, new CubicEase {EasingMode = EasingMode.EaseInOut})
                    .AddEasingKeyFrame(Duration*0.8, -60, new CubicEase {EasingMode = EasingMode.EaseInOut})
                    .AddEasingKeyFrame(Duration,-70),

                element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(Duration*0.7, transform.TranslateY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY + Distance, new CubicEase { EasingMode = EasingMode.EaseIn}),

                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration*0.9, 1)
                    .AddEasingKeyFrame(Duration, 0),
            };
        }
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var frame = Application.Current.RootVisual as Frame;

            if (frame == null)
            {
                return new Timeline[] {}
            }
            ;
            if (element == null)
            {
                return new Timeline[] {}
            }
            ;

            var ttv          = FromElement.TransformToVisual(Application.Current.RootVisual);
            var screenCoords = ttv.Transform(new Point(0, 0));
            var size         = FromElement.RenderSize;
            var fromScaleX   = size.Width / frame.ActualWidth;
            var fromScaleY   = size.Height / frame.ActualHeight;

            return(new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                .AddDiscreteKeyFrame(0.0, new Point(0.0, 0.0)),

                element.AnimateProperty(AnimationProperty.TranslateX)
                .AddEasingKeyFrame(0.0, screenCoords.X)
                .AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
                element.AnimateProperty(AnimationProperty.TranslateY)
                .AddEasingKeyFrame(0.0, screenCoords.Y)
                .AddEasingKeyFrame(Duration, 0, new QuadraticEase()),

                element.AnimateProperty(AnimationProperty.ScaleX)
                .AddEasingKeyFrame(0.0, fromScaleX)
                .AddEasingKeyFrame(Duration, 1.0, new QuadraticEase()),
                element.AnimateProperty(AnimationProperty.ScaleY)
                .AddEasingKeyFrame(0.0, fromScaleY)
                .AddEasingKeyFrame(Duration, 1.0, new QuadraticEase()),

                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration / 4, 1)
                .AddEasingKeyFrame(Duration, 1),
            });
        }
    }
#endif
}
Exemple #23
0
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(Reverse ? AnimationProperty.RotationX : AnimationProperty.RotationY)
         .AddEasingKeyFrame(0.0, 180)
         .AddEasingKeyFrame(Duration * 0.75, 0, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         }),
         element.AnimateProperty(Reverse ? AnimationProperty.RotationY : AnimationProperty.RotationX)
         .AddEasingKeyFrame(Duration * 0.25, 180)
         .AddEasingKeyFrame(Duration, 0, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         }),
     });
 }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, 1.07 * Amplify)
         .AddEasingKeyFrame(Duration, 1.0, new BackEase {
             Amplitude = 0.4, EasingMode = EasingMode.EaseIn
         }),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1.07 * Amplify)
         .AddEasingKeyFrame(Duration, 1.0, new BackEase {
             Amplitude = 0.4, EasingMode = EasingMode.EaseIn
         })
     });
 }
Exemple #25
0
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var shape = element as Shape;

            if (shape == null)
            {
                return new Timeline[] {}
            }
            ;

            var timeline = element.AnimateProperty("(Shape.StrokeThickness)");

            timeline.EnableDependentAnimation = true;
            var defaultThickness = shape.StrokeThickness;

            return(new Timeline[]
            {
                timeline
                .AddEasingKeyFrame(0.0, defaultThickness)
                .AddEasingKeyFrame(Duration * 0.25, Reverse ? MaxSize : MinSize, new QuadraticEase {
                    EasingMode = EasingMode.EaseInOut
                })
                .AddEasingKeyFrame(Duration * 0.75, Reverse ? MinSize : MaxSize, new QuadraticEase {
                    EasingMode = EasingMode.EaseInOut
                })
                .AddEasingKeyFrame(Duration, defaultThickness),
            });
        }
    }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.Opacity)
         .AddEasingKeyFrame(0.0, 0)
         .AddEasingKeyFrame(Duration / 2, 1)
         .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, StartScale)
         .AddEasingKeyFrame(Duration, 1.0, new CubicEase()),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, StartScale)
         .AddEasingKeyFrame(Duration, 1.0, new CubicEase()),
     });
 }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.Opacity)
             .AddEasingKeyFrame(0.0, 0)
             .AddEasingKeyFrame(Duration/2, 1)
             .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.ScaleX)
             .AddEasingKeyFrame(0.0, StartScale)
             .AddEasingKeyFrame(Duration, 1.0, new CubicEase()),
         element.AnimateProperty(AnimationProperty.ScaleY)
             .AddEasingKeyFrame(0.0, StartScale)
             .AddEasingKeyFrame(Duration, 1.0, new CubicEase()),
     };
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            double startRotation = 0.0;
            double endRotation;

            if (StartRotation.HasValue)
                startRotation = StartRotation.Value;
            else
            {
                var compositeTransform = element.RenderTransform as CompositeTransform;
                if (compositeTransform != null)
                    startRotation = compositeTransform.Rotation;
            }
            if (EndRotation.HasValue)
                endRotation = EndRotation.Value;
            else
                endRotation = startRotation + 360.0;

            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.5, 0.5)),

                element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(0.0, startRotation)
                    .AddEasingKeyFrame(Duration, endRotation, Easing)
                    .AddDiscreteKeyFrame(Duration, startRotation),
            };
        }
Exemple #29
0
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.CentreOfRotationX)
         .AddDiscreteKeyFrame(0.0, Centre),
         element.AnimateProperty(AnimationProperty.RotationY)
         .AddEasingKeyFrame(0.0, 0)
         .AddEasingKeyFrame(Duration, Reverse ? 90 : -90, new QuarticEase {
             EasingMode = EasingMode.EaseOut
         }),
         element.AnimateProperty(AnimationProperty.Opacity)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration, 0),
     });
 }
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var list = new List <Timeline>();

            if (FromDirection != ZDirection.Steady)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.ScaleX)
                    .AddEasingKeyFrame(0.0, (FromDirection == ZDirection.Away ? 0.3 : 2.0))
                    .AddEasingKeyFrame(Duration, 1, new BackEase {
                    Amplitude = Amplitude
                }));
                list.Add(
                    element.AnimateProperty(AnimationProperty.ScaleY)
                    .AddEasingKeyFrame(0.0, (FromDirection == ZDirection.Away ? 0.3 : 2.0))
                    .AddEasingKeyFrame(Duration, 1, new BackEase {
                    Amplitude = Amplitude
                }));
            }
            ;
            list.Add(
                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration / 4, 1));
            if (Math.Abs(DistanceX) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, transform.TranslateX + DistanceX)
                    .AddEasingKeyFrame(Duration, transform.TranslateX, new BackEase {
                    Amplitude = Amplitude
                }));
            }
            if (Math.Abs(DistanceY) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(0.0, transform.TranslateY + DistanceY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY, new BackEase {
                    Amplitude = Amplitude
                }));
            }

            return(list);
        }
        /***********************************************************************************/

        private static IEnumerable <Timeline> RotateAnimation(FrameworkElement element, double seconds, double rotation, EasingFunctionBase easingFunction = null)
        {
            return(new Timeline[]
            {
                element.AnimateProperty("(UIElement.RenderTransform).(CompositeTransformation.Rotation)")
                .AddEasingKeyFrame(seconds, rotation, easingFunction),
            });
        }
Exemple #32
0
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.Rotation)
         .AddEasingKeyFrame(0, Reverse ? 360 : -360)
         .AddEasingKeyFrame(Duration, 0),
     });
 }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
         .AddDiscreteKeyFrame(0.0, new Point(HorizontalCentre, 0.5)),
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration, 0.95),     //, new CubicEase { EasingMode = EasingMode.EaseIn });
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration, 0.95),     //, new CubicEase { EasingMode = EasingMode.EaseIn });
         element.AnimateProperty(AnimationProperty.Opacity)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration / 4, 1)
         .AddEasingKeyFrame(Duration, 0.7),
     });
 }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
             .AddDiscreteKeyFrame(0.0, new Point(HorizontalCentre, 0.5)),
         element.AnimateProperty(AnimationProperty.ScaleX)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration, 0.95), //, new CubicEase { EasingMode = EasingMode.EaseIn });
         element.AnimateProperty(AnimationProperty.ScaleY)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration, 0.95), //, new CubicEase { EasingMode = EasingMode.EaseIn });
         element.AnimateProperty(AnimationProperty.Opacity)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration/4, 1)
             .AddEasingKeyFrame(Duration, 0.7),
     };
 }
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var list = new List <Timeline>
            {
                element.AnimateProperty(AnimationProperty.ScaleX)
                .AddEasingKeyFrame(0.0, 1)
                .AddEasingKeyFrame(Duration, (ToDirection == ZDirection.Away ? 0.3 : 2.0), new BackEase {
                    Amplitude = Amplitude, EasingMode = EasingMode.EaseIn
                }),
                element.AnimateProperty(AnimationProperty.ScaleY)
                .AddEasingKeyFrame(0.0, 1)
                .AddEasingKeyFrame(Duration, (ToDirection == ZDirection.Away ? 0.3 : 2.0), new BackEase {
                    Amplitude = Amplitude, EasingMode = EasingMode.EaseIn
                }),
                element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 1)
                .AddEasingKeyFrame(Duration / 2, 1)
                .AddEasingKeyFrame(Duration, 0)
            };

            if (Math.Abs(DistanceX) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                    //.AddEasingKeyFrame(0.0, transform.TranslateX)
                    .AddEasingKeyFrame(Duration, transform.TranslateX + DistanceX, new BackEase {
                    Amplitude = Amplitude, EasingMode = EasingMode.EaseIn
                }));
            }
            if (Math.Abs(DistanceY) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                    //.AddEasingKeyFrame(0.0, transform.TranslateY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY + DistanceY, new BackEase {
                    Amplitude = Amplitude, EasingMode = EasingMode.EaseIn
                }));
            }
            return(list);
        }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration, EndScale, new CubicEase {
             EasingMode = EasingMode.EaseIn
         }),
         element.AnimateProperty(AnimationProperty.ScaleY)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration, EndScale, new CubicEase {
             EasingMode = EasingMode.EaseIn
         }),
         element.AnimateProperty(AnimationProperty.Opacity)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration / 2, 1)
         .AddEasingKeyFrame(Duration, 0),
     });
 }
        public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
        {
#if NETFX_CORE || WINDOWS_81_PORTABLE
            var frame = Window.Current.Content as Frame;
            var width = (frame != null) ? frame.ActualWidth : 1024;
#elif WINDOWS_PHONE
            var frame = Application.Current.RootVisual as PhoneApplicationFrame;
            var width = (frame != null) ? frame.ActualWidth : 250;
#endif

            return(new Timeline[]
            {
                element.AnimateProperty(AnimationProperty.TranslateX)
                .AddEasingKeyFrame(0.0, 0)
                .AddEasingKeyFrame(Duration / 2, width / 2, new QuadraticEase())
                .AddEasingKeyFrame(Duration, 0.0, new QuadraticEase {
                    EasingMode = EasingMode.EaseInOut
                }),

                element.AnimateObjectProperty(AnimationProperty.ZIndex)
                .AddDiscreteKeyFrame(Duration / 2, 0),

                element.AnimateProperty(AnimationProperty.CentreOfRotationX)
                .AddDiscreteKeyFrame(0.0, 0),
                element.AnimateProperty(AnimationProperty.RotationY)
                .AddEasingKeyFrame(0, 0)
                .AddEasingKeyFrame(Duration / 2, -25, new QuadraticEase {
                    EasingMode = EasingMode.EaseOut
                })
                .AddEasingKeyFrame(Duration, 0),

                element.AnimateProperty(AnimationProperty.ScaleX)
                .AddEasingKeyFrame(0.0, 1)
                .AddEasingKeyFrame(Duration, 0.95),     //, new CubicEase { EasingMode = EasingMode.EaseIn });
                element.AnimateProperty(AnimationProperty.ScaleY)
                .AddEasingKeyFrame(0.0, 1)
                .AddEasingKeyFrame(Duration, 0.95),     //, new CubicEase { EasingMode = EasingMode.EaseIn });
            });
        }
 public override IEnumerable <Timeline> CreateAnimation(FrameworkElement element)
 {
     return(new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.TranslateY)
         .AddEasingKeyFrame(0.0, 0, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
         .AddEasingKeyFrame(Duration, Distance, new QuadraticEase {
             EasingMode = EasingMode.EaseInOut
         })
     });
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var list = new List<Timeline>();

            if (FromDirection != ZDirection.Steady)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.ScaleX)
                        .AddEasingKeyFrame(0.0, (FromDirection == ZDirection.Away ? 0.3 : 2.0))
                        .AddEasingKeyFrame(Duration, 1, new BackEase {Amplitude = Amplitude}));
                list.Add(
                    element.AnimateProperty(AnimationProperty.ScaleY)
                        .AddEasingKeyFrame(0.0, (FromDirection == ZDirection.Away ? 0.3 : 2.0))
                        .AddEasingKeyFrame(Duration, 1, new BackEase {Amplitude = Amplitude}));
            };
            list.Add(
                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration/4, 1));
            if (Math.Abs(DistanceX) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, transform.TranslateX + DistanceX)
                    .AddEasingKeyFrame(Duration, transform.TranslateX, new BackEase {Amplitude = Amplitude}));
            }
            if (Math.Abs(DistanceY) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(0.0, transform.TranslateY + DistanceY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY, new BackEase {Amplitude = Amplitude}));
            }

            return list;
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            return new Timeline[]
            {
                element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(Duration*0.15, -5)
                    .AddEasingKeyFrame(Duration*0.3, 3)
                    .AddEasingKeyFrame(Duration*0.45, -3)
                    .AddEasingKeyFrame(Duration*0.6, 2)
                    .AddEasingKeyFrame(Duration*0.75, -1)
                    .AddEasingKeyFrame(Duration, 0),
                element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, transform.TranslateX)
                    .AddEasingKeyFrame(Duration*0.15, transform.TranslateX - Distance)
                    .AddEasingKeyFrame(Duration*0.3, transform.TranslateX + (Distance * 0.8))
                    .AddEasingKeyFrame(Duration*0.45, transform.TranslateX - (Distance * 0.6))
                    .AddEasingKeyFrame(Duration*0.6, transform.TranslateX + (Distance * 0.4))
                    .AddEasingKeyFrame(Duration*0.75, transform.TranslateX - (Distance * 0.2))
                    .AddEasingKeyFrame(Duration, transform.TranslateX)
            };
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var frame = Application.Current.RootVisual as Frame;
            if (frame == null) return new Timeline[] {};
            if (element == null) return new Timeline[] {};

            var ttv = FromElement.TransformToVisual(Application.Current.RootVisual);
            var screenCoords = ttv.Transform(new Point(0, 0));
            var size = FromElement.RenderSize;
            var fromScaleX = size.Width/frame.ActualWidth;
            var fromScaleY = size.Height/frame.ActualHeight;

            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.0, 0.0)),

                element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, screenCoords.X)
                    .AddEasingKeyFrame(Duration, 0, new QuadraticEase()),
                element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(0.0, screenCoords.Y)
                    .AddEasingKeyFrame(Duration, 0, new QuadraticEase()),

                element.AnimateProperty(AnimationProperty.ScaleX)
                    .AddEasingKeyFrame(0.0, fromScaleX)
                    .AddEasingKeyFrame(Duration, 1.0, new QuadraticEase()),
                element.AnimateProperty(AnimationProperty.ScaleY)
                    .AddEasingKeyFrame(0.0, fromScaleY)
                    .AddEasingKeyFrame(Duration, 1.0, new QuadraticEase()),

                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration/4, 1)
                    .AddEasingKeyFrame(Duration, 1),
            };
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            if (Count == 0) Count = 2;
            double halfDuration = (Duration/Count/2);
            double position = halfDuration;

            var animation = element.AnimateProperty(AnimationProperty.Opacity)
                .AddEasingKeyFrame(0.0, 1);
            for (int i = 0; i < Count; i++)
            {
                animation.AddEasingKeyFrame(position, 0);
                position += halfDuration;
                animation.AddEasingKeyFrame(position, 1);
                position += halfDuration;
            }
            return new Timeline[] { animation };
        }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.TranslateY)
             .AddEasingKeyFrame(0.0, 0, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
             .AddEasingKeyFrame(Duration, Distance, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
     };
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.5, 1)),
                element.AnimateProperty(AnimationProperty.ScaleY)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration*0.2, 0.6)
                    .AddEasingKeyFrame(Duration*0.4, 1.2)
                    .AddEasingKeyFrame(Duration*0.8, 1)
                    .AddEasingKeyFrame(Duration*1.0, 0.6)
                    .AddEasingKeyFrame(Duration*1.2, 1),
                element.AnimateProperty(AnimationProperty.TranslateY)
                    .AddEasingKeyFrame(0.0, transform.TranslateY)
                    .AddEasingKeyFrame(Duration*0.2, transform.TranslateY)
                    .AddEasingKeyFrame(Duration*0.4, transform.TranslateY + Distance)
                    .AddEasingKeyFrame(Duration*0.6, transform.TranslateY + Distance)
                    .AddEasingKeyFrame(Duration*0.8, transform.TranslateY + (Distance/2))
                    .AddEasingKeyFrame(Duration*1.0, transform.TranslateY),
            };
        }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
             .AddEasingKeyFrame(0.0, 1, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
             .AddEasingKeyFrame(Duration/2, MaxScale, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
             .AddEasingKeyFrame(Duration, 1, new QuadraticEase {EasingMode = EasingMode.EaseInOut}),
         element.AnimateProperty(AnimationProperty.ScaleY)
             .AddEasingKeyFrame(0.0, 1, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
             .AddEasingKeyFrame(Duration/2, MaxScale, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
             .AddEasingKeyFrame(Duration, 1, new QuadraticEase {EasingMode = EasingMode.EaseInOut})
     };
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            double startRotation = 0.0;
            double endRotation;

            if (StartRotation.HasValue)
                startRotation = StartRotation.Value;
            else
            {
                var compositeTransform = element.RenderTransform as CompositeTransform;
                if (compositeTransform != null)
                    startRotation = compositeTransform.Rotation;
            }
            if (EndRotation.HasValue)
                endRotation = EndRotation.Value;
            else
                endRotation = startRotation + 360.0;

            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.5, 0.5)),

                element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(0.0, startRotation)
                    .AddEasingKeyFrame(Duration, endRotation, Easing)
                    .AddDiscreteKeyFrame(Duration, startRotation),
            };
        }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     var list = new List<Timeline>();
     if (RotateDirection == RotateAnimationDirection.RotateUp)
     {
         list.Add(element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
             .AddDiscreteKeyFrame(0.0, new Point(0.0, 1.5)));
         list.Add(element.AnimateProperty(AnimationProperty.Rotation)
             .AddEasingKeyFrame(0.0, 0)
             .AddEasingKeyFrame(Duration, 45, new QuadraticEase {EasingMode = EasingMode.EaseOut}));
     }
     else
     {
         list.Add(element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
             .AddDiscreteKeyFrame(0.0, new Point(0.0, -0.5)));
         list.Add(element.AnimateProperty(AnimationProperty.Rotation)
             .AddEasingKeyFrame(0.0, 0)
             .AddEasingKeyFrame(Duration, -45, new QuadraticEase {EasingMode = EasingMode.EaseOut}));
     }
     list.Add(element.AnimateProperty(AnimationProperty.Opacity)
         .AddEasingKeyFrame(0.0, 1)
         .AddEasingKeyFrame(Duration/2, 1)
         .AddEasingKeyFrame(Duration, 0));
     return list;
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.5, 0)),

                element.AnimateProperty(AnimationProperty.Rotation)
                    .AddEasingKeyFrame(Duration*0.2, Distance)
                    .AddEasingKeyFrame(Duration*0.4, -(Distance * 0.66))
                    .AddEasingKeyFrame(Duration*0.6, Distance * 0.33)
                    .AddEasingKeyFrame(Duration*0.8, -(Distance * 0.33))
                    .AddEasingKeyFrame(Duration, 0)
            };
        }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration*0.1, MinScale)
             .AddEasingKeyFrame(Duration*0.2, MinScale)
             .AddEasingKeyFrame(Duration*0.3, MaxScale)
             .AddEasingKeyFrame(Duration*0.9, MaxScale)
             .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.ScaleY)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration*0.1, MinScale)
             .AddEasingKeyFrame(Duration*0.2, MinScale)
             .AddEasingKeyFrame(Duration*0.3, MaxScale)
             .AddEasingKeyFrame(Duration*0.9, MaxScale)
             .AddEasingKeyFrame(Duration, 1),
         element.AnimateProperty(AnimationProperty.Rotation)
             .AddEasingKeyFrame(Duration*0.1, -3)
             .AddEasingKeyFrame(Duration*0.2, -3)
             .AddEasingKeyFrame(Duration*0.3, 3)
             .AddEasingKeyFrame(Duration*0.4, -3)
             .AddEasingKeyFrame(Duration*0.5, 3)
             .AddEasingKeyFrame(Duration*0.6, -3)
             .AddEasingKeyFrame(Duration*0.7, 3)
             .AddEasingKeyFrame(Duration*0.8, -3)
             .AddEasingKeyFrame(Duration*0.9, 3)
             .AddEasingKeyFrame(Duration, 0),
     };
 }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            #if NETFX_CORE || WINDOWS_81_PORTABLE
            var frame = Window.Current.Content as Frame;
            var width = (frame != null) ? frame.ActualWidth : 1024;
            #elif WINDOWS_PHONE
            var frame = Application.Current.RootVisual as PhoneApplicationFrame;
            var width = (frame != null) ? frame.ActualWidth : 250;
            #endif

            return new Timeline[]
            {
                element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration/2, width/2, new QuadraticEase())
                    .AddEasingKeyFrame(Duration, 0.0, new QuadraticEase {EasingMode = EasingMode.EaseInOut}),

                element.AnimateObjectProperty(AnimationProperty.ZIndex)
                    .AddDiscreteKeyFrame(Duration/2, 0),

                element.AnimateProperty(AnimationProperty.CentreOfRotationX)
                    .AddDiscreteKeyFrame(0.0, 0),
                element.AnimateProperty(AnimationProperty.RotationY)
                    .AddEasingKeyFrame(0, 0)
                    .AddEasingKeyFrame(Duration/2, -25, new QuadraticEase {EasingMode = EasingMode.EaseOut})
                    .AddEasingKeyFrame(Duration, 0),

                element.AnimateProperty(AnimationProperty.ScaleX)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration, 0.95), //, new CubicEase { EasingMode = EasingMode.EaseIn });
                element.AnimateProperty(AnimationProperty.ScaleY)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration, 0.95), //, new CubicEase { EasingMode = EasingMode.EaseIn });
            };
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            #if NETFX_CORE || WINDOWS_81_PORTABLE
            var frame = Window.Current.Content as Frame;
            var width = (frame != null) ? frame.ActualWidth : 1024;
            #elif WINDOWS_PHONE
            var frame = Application.Current.RootVisual as PhoneApplicationFrame;
            var width = (frame != null) ? frame.ActualWidth : 250;
            #endif

            return new Timeline[]
            {
                element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration, width*1.1, new CubicEase()),
                /*
                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration/4, 0),*/
            };
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            var transform = GetTransform(element);

            var list = new List<Timeline>
            {
                element.AnimateProperty(AnimationProperty.ScaleX)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration, (ToDirection == ZDirection.Away ? 0.3 : 2.0), new BackEase {Amplitude = Amplitude, EasingMode = EasingMode.EaseIn}),
                element.AnimateProperty(AnimationProperty.ScaleY)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration, (ToDirection == ZDirection.Away ? 0.3 : 2.0), new BackEase {Amplitude = Amplitude, EasingMode = EasingMode.EaseIn}),
                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 1)
                    .AddEasingKeyFrame(Duration/2, 1)
                    .AddEasingKeyFrame(Duration, 0)
            };
            if (Math.Abs(DistanceX) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateX)
                    //.AddEasingKeyFrame(0.0, transform.TranslateX)
                    .AddEasingKeyFrame(Duration, transform.TranslateX + DistanceX, new BackEase {Amplitude = Amplitude, EasingMode = EasingMode.EaseIn}));
            }
            if (Math.Abs(DistanceY) > 0)
            {
                list.Add(
                    element.AnimateProperty(AnimationProperty.TranslateY)
                    //.AddEasingKeyFrame(0.0, transform.TranslateY)
                    .AddEasingKeyFrame(Duration, transform.TranslateY + DistanceY, new BackEase {Amplitude = Amplitude, EasingMode = EasingMode.EaseIn}));
            }
            return list;
        }
        public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
        {
            #if NETFX_CORE || WINDOWS_81_PORTABLE
            var frame = Window.Current.Content as Frame;
            var width = (frame != null) ? frame.ActualWidth : 1024;
            #elif WINDOWS_PHONE
            var frame = Application.Current.RootVisual as PhoneApplicationFrame;
            var width = (frame != null) ? frame.ActualWidth : 250;
            #endif

            return new Timeline[]
            {
                element.AnimatePointProperty(AnimationProperty.RenderTransformOrigin)
                    .AddDiscreteKeyFrame(0.0, new Point(0.0, 0.5)),
                element.AnimateProperty(AnimationProperty.ScaleX)
                    .AddEasingKeyFrame(0.0, 1.0)
                    .AddEasingKeyFrame(Duration/2, JumpUp ? 0.95 : 1.05)
                    .AddEasingKeyFrame(Duration, 1, new CubicEase()),
                element.AnimateProperty(AnimationProperty.ScaleY)
                    .AddEasingKeyFrame(0.0, 1.0)
                    .AddEasingKeyFrame(Duration/2, JumpUp ? 0.95 : 1.05)
                    .AddEasingKeyFrame(Duration, 1, new CubicEase()),

                element.AnimateProperty(AnimationProperty.TranslateX)
                    .AddEasingKeyFrame(0.0, width)
                    .AddEasingKeyFrame(Duration, 0, new CubicEase()),
                element.AnimateProperty(AnimationProperty.Opacity)
                    .AddEasingKeyFrame(0.0, 0)
                    .AddEasingKeyFrame(Duration/4, 1),
            };
        }
 public override IEnumerable<Timeline> CreateAnimation(FrameworkElement element)
 {
     return new Timeline[]
     {
         element.AnimateProperty(AnimationProperty.ScaleX)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration, EndScale, new CubicEase {EasingMode = EasingMode.EaseIn}),
         element.AnimateProperty(AnimationProperty.ScaleY)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration, EndScale, new CubicEase {EasingMode = EasingMode.EaseIn}),
         element.AnimateProperty(AnimationProperty.Opacity)
             .AddEasingKeyFrame(0.0, 1)
             .AddEasingKeyFrame(Duration/2, 1)
             .AddEasingKeyFrame(Duration, 0),
     };
 }