简体   繁体   English

使用FluidKit时如何加速动画?

[英]How can I speed up the animations when using FluidKit?

I've using FluidKit in a WPF application and would like to speed up the animations. 我在WPF应用程序中使用了FluidKit ,并希望加快动画的速度。

SlideTransition slideTransition = Resources["SlideTransition"] as SlideTransition;
slideTransition.Direction = Direction.LeftToRight;
slideTransition.Duration = new Duration(new System.TimeSpan(1000)); //does not work
TransitionContainer.Transition = slideTransition;

It has a "Duration" property which is of type Duration which expects a TimeSpan, but any timespan I give it just causes there to be no animation. 它具有“ Duration”属性,该属性的类型为Duration,它需要一个TimeSpan,但是我给出的任何时间跨度只会导致没有动画。

How can I set a duration to control the speed of the animation? 如何设置持续时间以控制动画的速度?

(If anyone is looking for answers to this, I also posted it on the codeplex forum.) (如果有人在寻找答案,我也将其发布在了Codeplex论坛上。)

这有效:

slideTransition.Duration = TimeSpan.FromMilliseconds(200);

The TimeSpan constructor invoked in your example is the one taking a long , which corresponds to ticks. 在您的示例中调用的TimeSpan构造函数是采用long构造函数,它对应于刻度。 A time span tick unit represents 100-nanosecond. 时间跨度刻度单位代表100纳秒。 You're effectively starting an animation during 100 microseconds, which is why you're seeing no animation at all. 您实际上是在100微秒内开始播放动画,这就是为什么根本看不到动画的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM