开发者

Overriding themes in Windows Phone 7

开发者 https://www.devze.com 2023-02-09 09:08 出处:网络
Is there a开发者_Go百科 way to make the controls only use the Dark or Light theme? I\'m working on an application that is mostly dark, we have some dark custom backgrounds. All the textblocks are hand

Is there a开发者_Go百科 way to make the controls only use the Dark or Light theme? I'm working on an application that is mostly dark, we have some dark custom backgrounds. All the textblocks are handled, those are always white. But buttons, textboxes, checkboxes, radiobuttons. All those become black when the phone's theme is set to light, and they are barely visible.

The problem with this is that I found myself going to blend to handle the way each control looks on each of it states. E. G., in the Light theme, buttons text become black, and white only when pressed. Is there a way I can make the buttons only use the Dark theme? Disregarding what the actual theme setting for the phone is?

Thanks.


I'm afraid you just have to colour them all manually. In Blend, this means clicking "convert to local value" on each of the properties you care about.

At least, that's what I did - hopefully someone else has a nicer answer!


Either use things like PhoneForegroundBrush to automatically switch with the theme change or manually (explicitly) set color values.


Check out WP ThemeManager by Jeff Wilcox - https://github.com/jeffwilcox/wp-thememanager

It's also available as a NuGet package "PhoneThemeManager"

0

精彩评论

暂无评论...
验证码 换一张
取 消