Silverlight Feeds - All your Silverlight feeds in one place.

Sponsors

Saturday, June 04, 2011

SystemTray in WP7-Mango

by Corrado Cavalli via Corrado's BLogs on 6/4/2011 7:45:10 AM

Jaime Rodriguez in this post describes some new features of the SystemTray class in upcoming WP7 Mango release, I won’t repeat them since Jaime’s post is quite explanatory, I’ve instead investigated more the “Progress” feature mentioned on that post.

Here’s how I’ve configured my SystemTray on MainPage.xaml:

<phone:PhoneApplicationPage x:Class="SystemTrayBackground.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
...
shell:SystemTray.BackgroundColor="Blue"
shell:SystemTray.ForegroundColor="Yellow"
shell:SystemTray.Opacity="50"
shell:SystemTray.IsVisible="True"
>

and here’s what needed to display an indeterminate operation with some text:
 
ProgressIndicator indicator = new ProgressIndicator();
indicator.IsVisible = true;
indicator.IsIndeterminate = true;
indicator.Text = "Loading...";
SystemTray.SetProgressIndicator(this, indicator);
image

If you want more control, you can simply use this alternative:
 
ProgressIndicator indicator = new ProgressIndicator();
indicator.IsVisible = true;
indicator.IsIndeterminate = false;
indicator.Value = 0.5;
indicator.Text = "Loading - 50%";
SystemTray.SetProgressIndicator(this, indicator);

image

To remove it, just use:
SystemTray.SetProgressIndicator(this, null);
 
Really no more excuses to hide it ;-)

Technorati Tags: ,,

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us