How to force to use light theme in Windows Phone 7?
In my Windows Phone 7 app, I want to use the light theme, no matter wha开发者_Go百科t theme the user sets in the phone. How to do that ?
Do I need to custom the style or theme ? I just want the default light theme.
Thanks
Jeff Wilcox offers a good way to do this using a theme manager he developed.
http://www.jeff.wilcox.name/2012/01/phonethememanager/
There is a nice way of replacing the default brushes. Saves you setting Forecolor everywhere.
http://www.designersilverlight.com/2011/01/17/theme-forcing-for-windows-phone-7-silverlight/
You'll still need to set the background of the main layout node to the default background brush.
Background="{StaticResource PhoneBackgroundBrush}"
There is no way to force an app to use a specific theme.
The best you can do is create your own style for every control you use and mimic the light theme in your styles.
Beware, this can be a time consuming and tedious task. Be sure to test all pages and all controls in all states when both the light and dark themes have been specified by the user.
I've had to do this (but for the dark theme) and it's not something I'd do again out of choice.
There are a few tips on doing this from one of the PDC sessions on optimising performance http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/10/28/pdc-live-optimizing-performance-for-silverlight-windows-phone-7-applications.aspx
This is a very bad idea.
Windows Phones use OLED displays - the pixels generate light directly, they are not backlit. Power consumption is therefore highest for white pixels. This is why Microsoft is suddenly obsessed with light text on dark backgrounds. It's not a back-to-the-seventies thing.
If you do this you will cause ridiculous power consumption.
For the benefit of the jerk who voted down a factually correct answer, I quote page 63 of the Windows Phone 7 UI Design and Interaction Guide published in July 2010 by Microsoft.
Avoid using too much white in applications, such as white backgrounds, as this may have an impact on battery life for devices that have organic LED displays.
If you're wondering why Microsoft included a "light background" theme option, so am I.
精彩评论