3

What is the best way to structure a ProgressBar using Blend?

Right now I have

LayoutRoot > Panorama > PanoramaItem > ListBox

I want to have a progress bar 'behind' the ListBox, and hide it when my web request finishes. So, should I put the ListBox & ProgressBar into a StackPanel? Or should I just programatically add or remove the ListBox / ProgressBar?

I just want to do this the best way possible. Most of the tutorials I find are for progress bars that are just underneath an area of fixed height, and hid when loading completes.

3
  • just wrap then with a Grid, then toggle the Visibility.
    – Justin XL
    Nov 8, 2011 at 4:09
  • Don't use ProgressBar, use PerformanceProgressBar from the toolkit instead!
    – Matt Lacey
    Nov 8, 2011 at 11:05
  • 1
    And don't do that either, but instead use the build-in progress-bar, as Anheledir pointed out. Nov 8, 2011 at 12:24

1 Answer 1

6

With Windows Phone 7.5 you should use the SystemTray-class with the new ProgressIndicator property. It enables you to provide a progress indicator quick and easy and with a consistent look'n'feel for the user at the top of your screen. This would be the best user-experience possible (see image below) :-)

enter image description here

If you want to show the progressbar nevertheless in the middle of the empty ListBox you can arrange both controls for example with a Grid and toggle the visibility as you need it. Removing and re-creating those controls isn't recommened because it would use a much larger overhead in the background and may be not very performant. But as mentioned above it would be best-practice to use the system tray for status information, including the ProgressBar.

But wether you use the SystemTray-Class or using a ProgressBar control, you shouldn't only toggle the visibility, but also toggle the IsIndeterminate property - it's using resources when "true", even if the ProgessIndicator isn't visible!

1
  • does this ProgressIndicator have better performance than PerformanceProgressBar (which utilize Compositor thread) ?
    – onmyway133
    Dec 8, 2012 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.