This topic has not yet been rated - Rate this topic

SystemTray Class

April 12, 2014

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.

  NameDescription
Public methodSystemTrayCreates a new instance of the SystemTray class.
Top
  NameDescription
Public propertyStatic memberBackgroundColorGets or sets the background color of the system tray on the current application page.
Public propertyDispatcherGets the Dispatcher this object is associated with. (Inherited from DependencyObject.)
Public propertyStatic memberForegroundColorGets or sets the foreground color of the system tray on the current application page.
Public propertyStatic memberIsVisibleGets or sets the visibility of the system tray on the current application page.
Public propertyStatic memberOpacityGets or sets the opacity factor of the system tray on the current application page.
Public propertyStatic memberProgressIndicatorGets or sets the progress indicator on the system tray on the current application page.
Top
  NameDescription
Public methodCheckAccessDetermines whether the calling thread has access to this object. (Inherited from DependencyObject.)
Public methodClearValueClears the local value of a dependency property. (Inherited from DependencyObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAnimationBaseValueReturns any base value established for a Windows Phone dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject.)
Public methodStatic memberGetBackgroundColorGets the value of the BackgroundColor attached property for a specified phone application page.
Public methodStatic memberGetForegroundColorGets the value of the ForegroundColor attached property for a specified phone application page.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodStatic memberGetIsVisibleGets the value of the IsVisible attached property for a specified phone application page.
Public methodStatic memberGetOpacityGets the value of the Opacity attached property for a specified phone application page.
Public methodStatic memberGetProgressIndicatorGets the value of the ProgressIndicator attached property for a specified phone application page.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodReadLocalValueReturns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject.)
Public methodStatic memberSetBackgroundColorSets the value of the BackgroundColor attached property for a specified phone application page.
Public methodStatic memberSetForegroundColorGets the value of the ForegroundColor attached property for a specified phone application page..
Public methodStatic memberSetIsVisibleSets the value of the IsVisible attached property for a given phone application page.
Public methodStatic memberSetOpacitySets the value of the Opacity attached property for a specified phone application page.
Public methodStatic memberSetProgressIndicatorSets the value of the ProgressIndicator attached property for a specified phone application page.
Public methodSetValueSets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public fieldStatic memberBackgroundColorPropertyThe dependency property for BackgroundColor.
Public fieldStatic memberForegroundColorPropertyThe dependency property for ForegroundColor.
Public fieldStatic memberIsVisiblePropertyThe dependency property for IsVisible.
Public fieldStatic memberOpacityPropertyThe dependency property for Opacity.
Public fieldStatic memberProgressIndicatorPropertyThe 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: 8.1, 8.0, 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)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.