Windows Phone 8.1 for Developers – Theme resources

This blog post is part of a series about how Windows Phone 8.1 affects developers. The series is written in collaboration with Microsoft evangelist Peter Bryntesson, check out his blog here.


On Windows Phone we have the choice to set our theme to either Light or Dark – this will affect all apps and on top of that we also have the Accent Color to personalize our device even more. Windows 8.1 on the other side hasn’t themes or Accent Color but as the platforms converge we get same API on both platforms – but with slightly different behavior.


We couldn’t force our Windows Phone 8 app out of the box to only use the light theme but PhoneThemeManager made it possible. A single line of code and the app was forced into light theme. Though AppBars required some extra code and MessageBoxes wasn’t themed at all it worked really well.

Then came Windows Phone 8.1

With a single line of code in XAML we can force the app to a theme we want without additional code or hacks.

<Application x:Class="App2.App"

In this example it’s done in app.xaml which sets the theme to light across the app. But we are not limited to only set this property in app.xaml but we can also do it on any page or even on any FrameworkElement.

Accent Color

By changing accent color the user can get a feel of a more personalized device, and using this color in your app may enhance this feeling. In Windows Phone 8.0 we could do this with:

Background="{StaticResource PhoneAccentBrush}"

In Windows Phone 8.1 we got a new type of accentcolor resource:

Background="{ThemeResource SystemColorControlAccentColor}"

This also works in Windows 8.1 apps so that it’s possible to share XAML in universal apps and still take advantage of accent color. But since accent color doesn’t exist on Windows 8.1 the color we get will always be Blueberry.

No more restarts

Another new feature that comes with Windows Phone 8.1 is that the need to restart the app after changing theme is gone if you are using ThemeResource in your bindings. So changing accent color or theme will take effect immediately which is really cool.


This Post Has 6 Comments

  1. liupeng

    if I add RequestedTheme=”Light”,the devices’s statusbar will also light.

  2. Thuy

    Such a save-life feature! We no longer need to port Jeff’s ThemeManager for 8.1.

  3. revathi

    How to add an image on the commandbar and on tapping the image which is on the commandbar should make the icons access which is in the commandbar.

  4. Oguzhan

    RequestedTheme=”Light” works thank you.

Leave a Reply