SystemTray.SetBackgroundColor Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Sets the value of the BackgroundColor attached property for a specified phone application page.

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

Syntax

Public Shared Sub SetBackgroundColor ( _
    element As DependencyObject, _
    color As Color _
)
public static void SetBackgroundColor(
    DependencyObject element,
    Color color
)

Parameters

Remarks

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

Examples

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);
        }
    }
}
Imports Microsoft.Phone.Shell

Partial Public Class MainPage
    Inherits PhoneApplicationPage

    Dim prog As ProgressIndicator
    
    Public Sub New()
        InitializeComponent()

        SystemTray.SetIsVisible(Me, true)
        SystemTray.SetOpacity(Me, 0.5)
        SystemTray.SetBackgroundColor(Me, Colors.Blue)
        SystemTray.SetForegroundColor(Me, Colors.Yellow)

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

        SystemTray.SetProgressIndicator(Me, prog)
    End Sub
End Class

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

SystemTray Class

Microsoft.Phone.Shell Namespace

PhoneApplicationPage

Other Resources

Dependency Properties Overview

Attached Properties Overview