Subscribe to the RSS feed then follow me on twitter at @mrlacey (misc) and @wpug (WPDev news)

Thursday, March 10, 2011

Gotchas when forcing the theme colour in a Windows Phone 7 app

Windows Phone 7 support two background themes: light and dark.

When combined with the accent colour, this allow the user a level of customization and personalization of their device and the applications they use.

As a general rule it's good to allow your application to reflect the theme and accent colout the user has selected. Sometimes, however, you may want to "force" the theme of the app. This means that regardless of the them the user selects the application always looks the same.

Look at these two versions of the same app:
The image on the left was taken with the dark them selected and the one on the right with the light theme.
It looks like all is fine.

However, if we want to support the inclusion of the `SystemTray`, so that the user can see the time, battery level, network conection status, etc. then the system theme colour will show through and there's nothing you can do about it. Apart from not include the SystemTray, of course.

If you want to use a MessageBox in your application then you'l have a similar issue. This is what the default MessageBox looks like when a light theme is selected but a dark theme is forced.

The solution is to make your own version of a MessageBox.

Creating your own version of a message box is relatively simple. Creating your own SIP/Keyboard is a lot more complicated if you want to recreate all the functionality of the built in one.
My advice, don't force the theme unless you have a REALLY good reason and have the time and patience to deal with all the consequences.

Are you a Windows Phone developer? If so, you could be getting rewards for the apps you build and the success they achieve by joining Nokia's DVLUP program.

2 comments:

  1. Good post - interesting topic.

    It's also quite fascinating how many apps now seem designed solely for the dark theme - does anyone use light :)

    Out of interesting... if you force the theme across to Dark, then are there any gotchas in the application bar, or does this just work?

    ReplyDelete
  2. @slodge
    The Twitter and Facebok apps force a variation on the light theme. I've seena few others but yes, dark does seem more popular.

    Nope, the app bar is another item you have to handle specifically if you are forcing a theme. You also have to be very careful with the automatic conversion dow to appbar images if the one you're forcing is all white.

    ReplyDelete