Beispiel #1
0
        private void ApplyPageHeaderAnimation(AnimationContext context)
        {
            if (this.InOutAnimationMode == InOutAnimationMode.Out)
            {
                return;
            }

            this.headerElementAnimation = new RadMoveAndFadeAnimation();
            this.headerElementScreenShotInfo.ScreenShotContainer.Opacity = 0;
            this.headerElementAnimation.FadeAnimation.StartOpacity       = 0;
            this.headerElementAnimation.FadeAnimation.EndOpacity         = this.headerElementScreenShotInfo.OriginalOpacity;
            Point startPoint = new Point(0, 250);
            Point endPoint   = new Point(0, 0);

            this.headerElementAnimation.MoveAnimation.StartPoint = startPoint;
            this.headerElementAnimation.MoveAnimation.EndPoint   = endPoint;

            this.headerElementAnimation.InitialDelay = TimeSpan.FromMilliseconds(70);                //// totalDuration.TimeSpan.TotalMilliseconds/2);
            this.headerElementAnimation.Duration     = new Duration(TimeSpan.FromMilliseconds(190)); //// new Duration(TimeSpan.FromMilliseconds(totalDuration.TimeSpan.TotalMilliseconds / 2));

            ExponentialEase easing = new ExponentialEase();

            easing.EasingMode = EasingMode.EaseOut;

            this.headerElementAnimation.Easing = easing;
            this.headerElementAnimation.Ended += this.HeaderElementAnimation_Ended;
        }
        private void ApplyPageHeaderAnimation()
        {
            this.headerElementAnimation = new RadMoveAndFadeAnimation();

            if (this.InOutAnimationMode == InOutAnimationMode.Out)
            {
                this.headerElementAnimation.FadeAnimation.EndOpacity = 0;
                this.headerElementAnimation.InitialDelay             = TimeSpan.FromMilliseconds(400);
                this.headerElementAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(0));
            }
            else
            {
                this.headerElementAnimation.FadeAnimation.StartOpacity = 0;
                this.headerElementAnimation.FadeAnimation.EndOpacity   = this.headerElementScreenShotInfo.OriginalOpacity;

                this.headerElementAnimation.MoveAnimation.StartPoint = new Point(0, -1 * (this.headerElementScreenShotInfo.OriginalLocation.Y + (2 * this.headerElement.ActualHeight)));
                this.headerElementAnimation.MoveAnimation.EndPoint   = new Point(0, 0);

                ExponentialEase easing = new ExponentialEase();
                easing.Exponent   = 5;
                easing.EasingMode = EasingMode.EaseOut;
                this.headerElementAnimation.Easing = easing;
            }

            this.headerElementAnimation.Ended += this.HeaderElementAnimation_Ended;
        }
        private void ApplyContinuumElementAnimation()
        {
            this.continuumElementAnimation = new RadMoveAndFadeAnimation();
            FrameworkElement rootVisual = Window.Current.Content as FrameworkElement;

            QuadraticEase easing = new QuadraticEase();

            if (this.InOutAnimationMode == InOutAnimationMode.Out)
            {
                double durationInMs = 200;
                double keyTime      = 0.2 * durationInMs;
                easing.EasingMode = EasingMode.EaseIn;
                this.continuumElementAnimation.MoveAnimation.StartPoint = new Point(0, 0);
                DoubleKeyFrameCollection middlePointsY = new DoubleKeyFrameCollection();
                middlePointsY.Add(new EasingDoubleKeyFrame()
                {
                    KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(keyTime)), Value = 20
                });
                this.continuumElementAnimation.MoveAnimation.MiddlePointsYAxis = middlePointsY;

                DoubleKeyFrameCollection middlePointsX = new DoubleKeyFrameCollection();
                middlePointsX.Add(new EasingDoubleKeyFrame()
                {
                    KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(keyTime)), Value = 10
                });
                this.continuumElementAnimation.MoveAnimation.MiddlePointsXAxis = middlePointsX;

                this.continuumElementAnimation.MoveAnimation.EndPoint     = new Point(rootVisual.ActualWidth, this.continuumElement.ActualHeight);
                this.continuumElementAnimation.FadeAnimation.StartOpacity = 1;
                this.continuumElementAnimation.FadeAnimation.EndOpacity   = 0;

                this.continuumElementAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(durationInMs));
            }
            else
            {
                this.continuumElementAnimation.MoveAnimation.StartPoint   = new Point((-1 * this.continuumElement.ActualWidth) - this.continuumElementScreenShotInfo.OriginalLocation.X, -2 * this.continuumElement.ActualHeight);
                this.continuumElementAnimation.MoveAnimation.EndPoint     = new Point(0, 0);
                this.continuumElementAnimation.FadeAnimation.StartOpacity = 0;
                this.continuumElementAnimation.FadeAnimation.EndOpacity   = 1;
                this.continuumElementAnimation.Duration = TimeSpan.FromMilliseconds(200);
                easing.EasingMode = EasingMode.EaseOut;
            }

            this.continuumElementAnimation.Easing = easing;

            this.continuumElementAnimation.Ended += this.ContinuumElementAnimation_Ended;
        }
Beispiel #4
0
        private void ApplyPageAnimation(AnimationContext context)
        {
            this.pageAnimation = new RadMoveAndFadeAnimation();
            if (this.InOutAnimationMode == InOutAnimationMode.Out)
            {
                this.pageAnimation.FadeAnimation.StartOpacity = 1;
                this.pageAnimation.FadeAnimation.EndOpacity   = 0;

                this.pageAnimation.MoveAnimation.EndPoint   = new Point(0, 200);
                this.pageAnimation.MoveAnimation.StartPoint = new Point(0, 0);
                this.pageAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(100));
            }
            else
            {
                this.pageAnimation.FadeAnimation.StartOpacity = 0;
                this.pageAnimation.FadeAnimation.EndOpacity   = 1;

                this.pageAnimation.MoveAnimation.StartPoint = new Point(0, 200);
                this.pageAnimation.MoveAnimation.EndPoint   = new Point(0, 0);
                this.pageAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(250));
            }
        }
Beispiel #5
0
        private void ApplyApplicationHeaderElementAnimation(AnimationContext context)
        {
            if (this.InOutAnimationMode == InOutAnimationMode.Out)
            {
                return;
            }

            QuadraticEase easing = new QuadraticEase();

            easing.EasingMode = EasingMode.EaseOut;

            this.applicationHeaderElementAnimation = new RadMoveAndFadeAnimation();

            Point startPoint = new Point(this.applicationHeaderElement.ActualWidth, -1 * (this.applicationHeaderElement.ActualHeight + this.applicationHeaderElementScreenShotInfo.OriginalLocation.Y));
            Point endPoint   = new Point(0, 0);

            this.applicationHeaderElementAnimation.MoveAnimation.StartPoint   = startPoint;
            this.applicationHeaderElementAnimation.MoveAnimation.EndPoint     = endPoint;
            this.applicationHeaderElementAnimation.FadeAnimation.StartOpacity = 0;
            this.applicationHeaderElementAnimation.FadeAnimation.EndOpacity   = 1;
            this.applicationHeaderElementAnimation.Easing   = easing;
            this.applicationHeaderElementAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(260));
            this.applicationHeaderElementAnimation.Ended   += this.ApplicationHeaderElementAnimation_Ended;
        }