views:

278

answers:

3

In WinForms you could set a progress bar to loop endlessly to indicate that you don't know how long it will take. How would I do that in WPF?

+1  A: 

I personally like the approach Visual Studio 2010 takes. They use an animation of a small, looping series of dots (with varying intensity). They just animate the dots circling in the center of the window in question.

In WPF, this is trivial - just animate a rotation of a small drawing of a circle of dots with the opacity set correctly up front.

I find it very intuitive, small, and unintrusive.

Reed Copsey
That can look nicers, but is way too much to learn for what needs to be quick and easy page.
Jonathan Allen
In Windows Forms, it was tough to implement. In WPF, it's very, very easy (especially if you're using Blend).
Reed Copsey
A: 

Is a progress bar the right widget for this? You are unable to indicate a % complete, since you "don't know how long it will take". Maybe an animation of some sort (like the Windows files-disappearing-into-thin-air-while-deleting effect) to show that activity is still going on would be better. But a "progress" bar that simply resets to zero because there is still more work to do just looks dumb to me.

Paul McGuire
It's not the same effect as constantly filling from 0 to 100 and then resetting. Progress bars in indeterminate mode are more like a small block of color constantly moving along the bar (or, in Vista and later, a solid yellow bar with a moving highlight). It's not the greatest animation, but it's fairly standard in Windows and is not easily confused with the logout process from Office Space.
ChrisV
+4  A: 
<ProgressBar IsIndeterminate="True" />
Morbo