post icon

Detecting Users Win7 Mobile Theme Color

If you want your Win7 mobile application to mimic the theme/system colors your users phone is using you can do so through the the use of the Theme Resources.

For example, the color of each of the tiles in your phone is called the “Accent” color. To obtain this color simply call:

SolidColorBrush brush=Application.Current.Resources["PhoneAccentBrush"] as SolidColorBrush;

Background and Foreground colors:

background = Application.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush;
foreground = Application.Current.Resources["PhoneForegroundBrush"] as SolidColorBrush;


For more details on the other colors available see: http://msdn.microsoft.com/en-us/library/ff769552(VS.92).aspx

Thanks,

–Mike

Trackbacks/Pingbacks

  1. Programming news: Mono 2.8.2, Joomla 1.6, WP7 tips | Programming and Development | TechRepublic.com - 18. Jan, 2011

    [...] Windows Phone 7 theme resources Michael Snow has a quick tip on how to access the Windows Phone 7 system colors so you can make your…. [...]