我正在测试 WPF 进度条并尝试将其重置为初始状态,但它不起作用。
Duration duration = new Duration(TimeSpan.FromSeconds(1));
DoubleAnimation doubleanimation = new DoubleAnimation(200.0, duration);
myProgress.IsIndeterminate = true;
myProgress.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);
myProgress.Value = 0;
在动画之前,进度条是静态的(没有动画)。动画结束后,进度条颜色现在为浅灰色(比以前更浅),并带有变亮的闪光效果。
评论时长和双动画时,进度条保持静止。我看到这个双重动画与此有关。
//Duration duration = new Duration(TimeSpan.FromSeconds(1));
//DoubleAnimation doubleanimation = new DoubleAnimation(200.0, duration);
myProgress.IsIndeterminate = true;
//myProgress.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);
myProgress.Value = 10;
myProgress.Value = 0;
我该如何解决这个 DoubleAnimation 问题?我在这里想念什么?