Global ProgressBar in WP7

I quite like to have a global Performance Progress Bar in my Windows Phone 7 apps so the user has a consistent frame of reference when I’m interacting with web services. The requirements are simple, a progress bar that appears on all pages without any special requirements (ie. no custom controls, special code snippets, etc.). It should be managed in one place, and be easy to extend. Fortunately the extreme flexibility Silverlight offers makes this a doddle:

Update: This method for displaying a global ProgressBar doesn’t always play well with the WP7 Toolkit Transitions. However, I would highly recommend using the WP7Contrib Transitions anyway (they work well with the global ProgressBar too). I’ve created a 3-part guide on the transitions here.

3 comments

Thank you for your solution, I’ve added it to my project and it works fine, but I get a problem: the pages transitions doesn’t work anymore. I’ve added following code:
RootFrame = new TransitionFrame()
{
Style = (Style)Resources[“mainFrameStyle”]

};
And also changed mainFrameStyle TargetType=”toolkit:TransitionFrame”.

Do you have any suggestions, or how to add global progress and keep pages transition working.

Off the top of my head I couldn’t tell you what the problem is, sadly. The TargetType of the style doesn’t need to change since anything that derives from the target type can still use the style (so for this reason it’s best to target the lowest level class you can). I suspect there’s something wrong with the template itself, I’ll have a look around later and see if there’s anything obvious.

In the meantime I would highly recommend using the WP7Contrib transitions instead of the Toolkit. They’re much faster and save considerable amounts of memory (40MB on the app I’m working on). They also work well with the global progress bar. I’ll be writing a blog post on easily implementing the transitions in the coming days.