当前位置: 首页>>代码示例>>C#>>正文


C# FrameworkElement.AnimatePointProperty方法代码示例

本文整理汇总了C#中FrameworkElement.AnimatePointProperty方法的典型用法代码示例。如果您正苦于以下问题:C# FrameworkElement.AnimatePointProperty方法的具体用法?C# FrameworkElement.AnimatePointProperty怎么用?C# FrameworkElement.AnimatePointProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrameworkElement的用法示例。


在下文中一共展示了FrameworkElement.AnimatePointProperty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateAnimation

        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*0.6, 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),
            };
        }
开发者ID:uwper,项目名称:AnimationManager,代码行数:25,代码来源:LightSpeedAnimations.cs

示例2: CreateAnimation

 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)),
     };
 }
开发者ID:uwper,项目名称:AnimationManager,代码行数:26,代码来源:ResetAnimation.cs

示例3: CreateAnimation

        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),
            };
        }
开发者ID:uwper,项目名称:AnimationManager,代码行数:50,代码来源:HingeAnimation.cs

示例4: CreateAnimation

 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),
     };
 }
开发者ID:uwper,项目名称:AnimationManager,代码行数:18,代码来源:FrameAnimations.cs

示例5: CreateAnimation

        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),
            };
        }
开发者ID:uwper,项目名称:AnimationManager,代码行数:29,代码来源:RotateAnimations.cs

示例6: CreateAnimation

        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),
            };
        }
开发者ID:uwper,项目名称:AnimationManager,代码行数:37,代码来源:ScaleAnimations.cs

示例7: CreateAnimation

        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)
            };
        }
开发者ID:uwper,项目名称:AnimationManager,代码行数:15,代码来源:AttentionAnimations.cs


注:本文中的FrameworkElement.AnimatePointProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。