ARTICLE

System Tray ProgressIndicator in Windows Phone 7.5 / Mango phone

Posted by Dhananjay Kumar Articles | F# October 02, 2011
This article explains how to work with the Progress Indicator in the System Tray to show the progress of async operation in a Windows Phone 7.5 . Mango phone.
Reader Level:

Windows Phone 7.5 (Mango) provides a Progress Indicator in the System Tray to show the progress of an async operation. 

ProgressIndicator in windows phone

The ProgressIndicator is a dependency object and can be data bound to the System Tray.

The ProgressIndicator class is defined as below:

windows phone ProgressIndicator
 
Using ProgressIndicator
 
To use a ProgressIndicator, you first need to add the namespace:

Progress Indicator
 
And then create it like below:

Progress Indicator in Mango phone
 
On the async operation status you can set visibility to false:

Mango phone Progress Indicator
 
Finally, you need to set it in the System Tray or Status Bar as below,

Progress Indicator
 
Putting it all together, the below listed source code will give you output as shown earlier in the post.
 
 
using System.Windows.Media;
 using
Microsoft.Phone.Controls;
 
using Microsoft.Phone.Shell;
 
namespace PhoneApp2
 {
     public partial class MainPage :
PhoneApplicationPage
 
    {
         public MainPage()
         {
             InitializeComponent();
             SystemTray.SetIsVisible(this, true);
             SystemTray.SetOpacity(this, 0.5);
             SystemTray.SetBackgroundColor(this, Colors.Black);
             SystemTray.SetForegroundColor(this, Colors.Blue);
             ProgressIndicator progressIndicator = new ProgressIndicator();
             progressIndicator.IsVisible = true;
             progressIndicator.IsIndeterminate = true;           
             progressIndicator.Text = "Hey I am Progress Indicator";        
             SystemTray.SetProgressIndicator(this, progressIndicator); 
         }
     }
 }
 

In this way you can use the System Tray Progress Indicator. I hope this post was useful. Thanks for reading

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter