Coding | .NET | C♯ | Angular | Ionic | Cordova | :-o

Menu

Windows Phone: Progress Indicator Plus

In Windows Phone, progress indicator on System Tray is a quick and easy way to indicate that some activity is running in the background. It is all right if you want to indicate progress from a single thread. What if you have multiple threads running and all need to use progress indicator?

I created a ProgressBarManager wrapper class to handle multiple thread progress indication scenario. This class can work in both scenarios – indeterminate or determinate, but in case of multiple background processes the preferable way is indeterminate. The accompanied progress text from different processes can show progress value in the text. Following is example screen shot of ProgressBarManager in action.

Usage Example

At class level define ProgressBarManager:

ProgressBarManager ProgressBarManager = new ProgressBarManager();

In constructor of the form where you wish to show progress bar with multiple clients, instantiate the class like so:

Update ProgressBar from different processes with the ProgressBarManager.Show(). In this example I have a button which starts two background threads which update progress bar asynchronously. The button’s click method is as follows: