"The background of the problem"
I believe that some of the experience of WP research and development students will encounter the following problems:
The Phoneaccentbrush brush (which defines the system's accent color, the user's chosen theme color) is heavily used in system controls and Wptoolkit.
In order to meet the requirements of the UI design, there are no more than 100 lines of XAML code defined for a color value, only one row is used to modify the color.
2, the use of TextBlock forget the setting foreground cause users to switch to the theme of white, a lot of words can not see clearly.
The following is an excerpt from the definition of the control template in Wptoolkit:
It's a good thing to do this, but here's how it can be sprayed directly:
"Solution"
Previously, I used blend edit Template copy to achieve the requirements (gorgeous display of a good XAML base =. =), know one day suddenly thought, we can change the system this resource ...
The author made several attempts, and finally solved the problem with the following code:
MainColor1 and Defaulitforegroundcolor are a color type of resource that I define in the program resource dictionary:
All we have to do is put the overwritesystemcolor on the last side of the app's constructor.
Such a tricky way then steal moved to modify the system defined color value, save a lot of things that have been very troublesome before!
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/