Windows Phone Dev – Changing the rootFrame Background Color


In my Windows Phone 8 Runtime app I wanted to change the rootFrame background color from the default (black) to a custom color.

Here is the solution highlighted in my App.xaml.cs:

if (rootFrame == null)
    // Create a Frame to act as the navigation context and navigate to the first page
    rootFrame = new Frame();

    SolidColorBrush color = new SolidColorBrush();
    color.Color = (Windows.UI.ColorHelper.FromArgb(0xFF, 44, 50, 50));
    rootFrame.Background = color;

As you can see I used Windows.UI.Color.Helper.FromArgb to specify a custom color. If you want to use a predefined color just use color.Color = Windows.UI.Colors.Black; with the color of your choice on line 72.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s