コード例 #1
0
ファイル: AnimationHelper.cs プロジェクト: BdGL3/CXPortal
        public static void StartAnimation (Transform animatableElement, DependencyProperty dependencyProperty, double toValue, double durationMilliseconds, double accelerationRatio, double decelerationRatio)
        {
            DoubleAnimation animation = new DoubleAnimation();
            animation.To = toValue;
            animation.AccelerationRatio = accelerationRatio;
            animation.DecelerationRatio = decelerationRatio;
            animation.FillBehavior = FillBehavior.HoldEnd;
            animation.Duration = TimeSpan.FromMilliseconds(durationMilliseconds);
            animation.Freeze();

            animatableElement.BeginAnimation(dependencyProperty, animation, HandoffBehavior.Compose);
        }
コード例 #2
0
 private void MoveItems(Transform form, TimeSpan span)
 {
     DoubleAnimation animation = new DoubleAnimation();
     animation.To = 0;
     animation.Duration = span;
     form.BeginAnimation(TranslateTransform.YProperty, animation);
 }
コード例 #3
0
        /// <summary>
        /// Führt die Animation für beide Contents aus
        /// </summary>
        private void _BeginAnimateContentReplacement()
        {
            OldContentTransform = new TranslateTransform();
            NewContentTransform = new TranslateTransform();

            _paintArea.Visibility = Visibility.Visible;
            _paintArea.RenderTransform = OldContentTransform;
            _mainContent.RenderTransform = NewContentTransform;

            IEasingFunction ease = new BackEase {
                Amplitude = 0.5,
                EasingMode = EasingMode.EaseInOut
            };

            NewContentTransform.BeginAnimation(TranslateTransform.XProperty, AnimateLib.CreateAnimation(this.ActualWidth, 0, 0, 1, ease));
            OldContentTransform.BeginAnimation(TranslateTransform.XProperty, AnimateLib.CreateAnimation(0, -this.ActualWidth, 0, 1, ease, (s, e) => {
                _paintArea.Visibility = Visibility.Hidden;
            }));
        }