Win8 metro and Windows Phone both use the XAML description interface, but there are some differences in style:
The topics of Win8 are controlled by developers and can be found in APP. XAML. CS.CodeSet requestedtheme = "dark" or light. You can also specify it directly in APP. XAML.
The theme of Windows Phone is controlled by users. Users can set a dark or light color in the system. In this way, developers must adapt to the two themes, which are generally set to a dark one, however, pay attention to whether the text in a light-colored topic can be properly displayed.
There is a tool that forces you to set the topic of an application to overwrite your settings. Reference http://www.dotblogs.com.tw/ouch1978/archive/2012/05/22/wp7-phone-theme-manager.aspx
Original article linkHttp://www.jeff.wilcox.name/2012/01/phonethememanager/
It is easy to use. Search for winodw phone theme manager in nuget and install the following code:
Thememanager. tolighttheme ();
To switch the topic of the Win8 Metro application, refer to here:
Http://mikaelkoskinen.net/post/windows-8-winrt-metro-xaml-application-theme-dark-light.aspx
This is also an official Microsoft example.
Another scenario is that the application uses a dark topic, but in some pages, such as "set" and "about" pages, the light topic needs to be used, then we need to overwrite the system topic. The default topic isC: \ Program Files (x86) \ Windows kits \ 8.0 \ include \ winrt \ XAML \ design \ contains two files: Generic. XAML and themeresources. XAML,You can open generic. see the content in the XAML, which contains various themes of dark and light. When the app starts, it calls the above image brush resources, therefore, style = "{staticresource itemtextstyle}" can be directly referenced in the XAML code. What if I want to change other topics on a page?
I thought of a stupid way to copy the paint brush of dark or light and the style of each control directly, and it should be able to overwrite the style of the system. But it always does not work. Later I thought it may be a key conflict, so I changed all the keys in the blend. Blend will prompt which styles use this paint brush and update them all. This is normal.
If you have a better solution, leave a message to discuss it.