Hello guys
I'm testing a WPF progress bar and trying to reset it to its initial state, but it doesn't work.
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;
Before animation, the progress bar is static (no animation). After animation, the progress bar color is now light gray (lighter than before) with a brightening flash effect.
When commenting duration and double animation, the progress bar remains static. I see there's something to do with this double animation.
//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;
How can I solve this DoubleAnimation issue? What am I missing here?