08
Oct
11

Using the System Tray to show progress in Windows Phone 7 Mango

Before Mango it was a little difficult to put a generic status message at the top of your page. The Mango tools have made this a bit easier by giving developers (more) access to the System Tray. That’s this part:

You are still a bit limited in what you can do (i.e. you can’t actually add or remove icons), but there’s a lot more flexibility than before.

You can access the system tray either in code or XAML using the Microsoft.Shell.SystemTray class. This class has the following dependency properties:

  • IsVisible
  • Opacity
  • BackgroundColor
  • ForegroundColor
  • ProgressIndicator

While it’s quite exciting to be able to style the status bar, I cried out of joy when I saw the ProgressIndicator property. Why…? Because now I can add progress information to the top of my pages quickly and easily! J

So, I want to add a downloading message and progress bar to the top of my page (above the application title) as follows:

Using XAML, I can add text and a progress bar to a page by dropping the following into the page:

<shell:SystemTray.ProgressIndicator>
    <shell:ProgressIndicator IsIndeterminate="true" IsVisible="True" Text="Click me..." />
</shell:SystemTray.ProgressIndicator>

Or, using code, I can accomplish the same thing by dropping this into my code:

ProgressIndicator progress = new ProgressIndicator
{
    IsVisible = true,
    IsIndeterminate = true,
    Text = "Downloading details..."
};
SystemTray.SetProgressIndicator(this, progress);

Feel free to download my sample application showing how to manipulate the System Tray:


Open SystemTraySample.zip

Advertisement

2 Responses to “Using the System Tray to show progress in Windows Phone 7 Mango”


  1. 1 Christophe
    10 October, 2011 at 10:22 pm

    Nice, good job. Exactly what I was looking for.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Twitter – @ducas

  • Being with Vodafone is a great way to keep my mobile costs down... Because whenever I try to use it I have no reception. 15 hours ago
  • The MS Mobile P&P team have made the source code for the Project #Liike reference application available - http://t.co/QgmoToij #mobileweb 2 days ago
  • Ctrl + Shift + Eject = Lock Screen on Mac... provided you have "require password after sleep or screensaver" on - http://t.co/wDHiQGNS 4 days ago
  • What makes someone use"warm regards" in their signature? Does it say anything about them? Does commenting say anything about me...? :-S 4 days ago
  • is it sad that i have a virtual machine to view a pdf using adobe acrobat...? 4 days ago

Flickr Photos

Photo A1267

More Photos

Follow

Get every new post delivered to your Inbox.

Join 507 other followers