How do I know whether WP7 is in its dark mode or light mode? I would like to show different images depending on which mode is active.
+6
A:
Visibility v = (Visibility)Resources["PhoneLightThemeVisibility"];
if (v == System.Windows.Visibility.Visible)
{
// light theme is active
}
else
{
// dark theme is active
}
jesperll
2010-09-23 07:58:43
So what is going to happen when they release further themes? Will we need to know all the theme resource names?
Dr Herbie
2010-09-23 09:35:46
As far as I know there is Dark Theme and Light Theme with Black/White background - there are no other background colours supported, the Accent Colour can vary, but in this case you should be ok for now, plus another handy tip is to use XAML-based icons where possible you can then apply the correct colour there.
RoguePlanetoid
2010-09-23 11:33:32
i don't think there's any plan for more than light/dark background. If there was, there'd be another theme visibility item, like how there's also a PhoneDarkThemeVisiblity resource, so you'd have to check a bunch of them :)
John Gardner
2010-09-23 16:16:32
That worked great, thanks.
Jake Pearson
2010-09-23 20:09:39