Windows Dev Center

SystemTray.SetForegroundColor Method

Gets the value of the ForegroundColor attached property for a specified phone application page..

Namespace:  Microsoft.Phone.Shell
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

public static void SetForegroundColor(
	DependencyObject element,
	Color color
)

Parameters

element
Type: System.Windows.DependencyObject
The page for which to set the ForegroundColor attached property.
color
Type: System.Windows.Media.Color
The foreground color to set for the system tray.

You cannot set the foreground to white. Use a color close to white instead.

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);
        }
    }
}

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2015 Microsoft