Ejemplo n.º 1
0
        private static void AnimateTranslateTransform(TranslateTransform tt, double toX, double toY, int durationInMs, ZoomBorder instance)
        {
            if (instance._translateAvailable == true)
            {
                instance._translateAvailable = false;
                instance._animationX         = new DoubleAnimation(toX, TimeSpan.FromMilliseconds(durationInMs))
                {
                    EasingFunction = new QuarticEase()
                    {
                        EasingMode = EasingMode.EaseOut
                    }
                };

                var animationY = new DoubleAnimation(toY, TimeSpan.FromMilliseconds(durationInMs))
                {
                    EasingFunction = new QuarticEase()
                    {
                        EasingMode = EasingMode.EaseOut
                    }
                };

                instance._animationX.Completed += instance._animationX_Completed;

                tt.BeginAnimation(TranslateTransform.XProperty, instance._animationX, HandoffBehavior.Compose);

                tt.BeginAnimation(TranslateTransform.YProperty, animationY, HandoffBehavior.Compose);
            }
        }