如何停止在C#/ WPF动画? [英] How to stop an animation in C# / WPF?

查看:449
本文介绍了如何停止在C#/ WPF动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的事情:


barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation(
    barProgress.Value, dNextProgressValue,
    new Duration(TimeSpan.FromSeconds(dDuration)));

现在,你将如何停止该动画(即 DoubleAnimation是)?我之所以想这样做,是因为我想开始新的动画(这似乎工作,但很难说),并最终停止最后的动画...

Now, how would you stop that animation (the DoubleAnimation)? The reason I want to do this, is because I would like to start new animations (this seems to work, but it's hard to tell) and eventually stop the last animation...

推荐答案

要阻止它,再次设置为null第二个参数调用BeginAnimation。

To stop it, call BeginAnimation again with the second argument set to null.

这篇关于如何停止在C#/ WPF动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆