This topic has not yet been rated - Rate this topic

SystemTray Class

Windows Phone

March 22, 2012

Provides methods and properties for interacting with the system tray on an application page.

System.Object
  System.Windows.DependencyObject
    Microsoft.Phone.Shell.SystemTray

Namespace:  Microsoft.Phone.Shell
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
XMLNS for XAML: Not mapped to an xmlns.
public class SystemTray : DependencyObject
<SystemTray .../>

The SystemTray type exposes the following members.

  Name Description
Public method SystemTray Creates a new instance of the SystemTray class.
Top
  Name Description
Public property Static member BackgroundColor Gets or sets the background color of the system tray on the current application page.
Public property Dispatcher (Inherited from DependencyObject.)
Public property Static member ForegroundColor Gets or sets the foreground color of the system tray on the current application page.
Public property Static member IsVisible Gets or sets the visibility of the system tray on the current application page.
Public property Static member Opacity Gets or sets the opacity factor of the system tray on the current application page.
Public property Static member ProgressIndicator Gets or sets the progress indicator on the system tray on the current application page.
Top
  Name Description
Public method CheckAccess (Inherited from DependencyObject.)
Public method ClearValue (Inherited from DependencyObject.)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetAnimationBaseValue (Inherited from DependencyObject.)
Public method Static member GetBackgroundColor Gets the value of the BackgroundColor attached property for a specified phone application page.
Public method Static member GetForegroundColor Gets the value of the ForegroundColor attached property for a specified phone application page.
Public method GetHashCode (Inherited from Object.)
Public method Static member GetIsVisible Gets the value of the IsVisible attached property for a specified phone application page.
Public method Static member GetOpacity Gets the value of the Opacity attached property for a specified phone application page.
Public method Static member GetProgressIndicator Gets the value of the ProgressIndicator attached property for a specified phone application page.
Public method GetType (Inherited from Object.)
Public method GetValue (Inherited from DependencyObject.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ReadLocalValue (Inherited from DependencyObject.)
Public method Static member SetBackgroundColor Sets the value of the BackgroundColor attached property for a specified phone application page.
Public method Static member SetForegroundColor Gets the value of the ForegroundColor attached property for a specified phone application page..
Public method Static member SetIsVisible Sets the value of the IsVisible attached property for a given phone application page.
Public method Static member SetOpacity Sets the value of the Opacity attached property for a specified phone application page.
Public method Static member SetProgressIndicator Sets the value of the ProgressIndicator attached property for a specified phone application page.
Public method SetValue (Inherited from DependencyObject.)
Public method ToString (Inherited from Object.)
Top
  Name Description
Public field Static member BackgroundColorProperty The dependency property for BackgroundColor.
Public field Static member ForegroundColorProperty The dependency property for ForegroundColor.
Public field Static member IsVisibleProperty The dependency property for IsVisible.
Public field Static member OpacityProperty The dependency property for Opacity.
Public field Static member ProgressIndicatorProperty The dependency property for ProgressIndicator.
Top

The system tray is also referred to as the status bar.

The following code example shows how to use the SystemTray class in conjunction with the ProgressIndicator class.

using Microsoft.Phone.Shell;

namespace SystemTrayTest
{
    public partial class MainPage : PhoneApplicationPage
    {
        ProgressIndicator prog;

        public MainPage()
        {
            InitializeComponent();

            SystemTray.SetIsVisible(this, true);
            SystemTray.SetOpacity(this, 0.5);
            SystemTray.SetBackgroundColor(this, Colors.Purple);
            SystemTray.SetForegroundColor(this, Colors.Yellow);

            prog = new ProgressIndicator();
            prog.IsVisible = true;
            prog.IsIndeterminate = true;
            prog.Text = "Click me...";

            SystemTray.SetProgressIndicator(this, prog);
        }
    }
}

The following code example shows how to use the ProgressIndicator on the SystemTray from XAML. This code goes inside your PHONE:PHONEAPPLICATIONPAGE element. Note that the IsIndeterminate, IsVisible, Text, and Value attributes can all be data-bound.

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

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Did you find this helpful?
(1500 characters remaining)