本文整理汇总了C#中System.Windows.Media.Transform.BeginAnimation方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.BeginAnimation方法的具体用法?C# Transform.BeginAnimation怎么用?C# Transform.BeginAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Transform
的用法示例。
在下文中一共展示了Transform.BeginAnimation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartAnimation
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: MoveItems
private void MoveItems(Transform form, TimeSpan span)
{
DoubleAnimation animation = new DoubleAnimation();
animation.To = 0;
animation.Duration = span;
form.BeginAnimation(TranslateTransform.YProperty, animation);
}
示例3: _BeginAnimateContentReplacement
/// <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;
}));
}