本文整理汇总了C#中FrameworkElement.AnimateObjectProperty方法的典型用法代码示例。如果您正苦于以下问题:C# FrameworkElement.AnimateObjectProperty方法的具体用法?C# FrameworkElement.AnimateObjectProperty怎么用?C# FrameworkElement.AnimateObjectProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameworkElement
的用法示例。
在下文中一共展示了FrameworkElement.AnimateObjectProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAnimation
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 });
};
}