Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to swap images based on the current theme WP7

I've failed certification because I have an image that's all white. So when a user switches to the light theme it fails because you can't see it. How do I swap this imaged based on the theme applied?

Thank you in advance

like image 520
Toran Billups Avatar asked Aug 25 '11 22:08

Toran Billups


1 Answers

Question Making an image control invert its colors depending on theme has a simple XAML only answer:

<Image HorizontalAlignment="Center"Stretch="None" Visibility="{StaticResource PhoneLightThemeVisibility}" Source="/MyApplication;component/imageDarkTheme.png" />
<Image HorizontalAlignment="Center" Stretch="None" Visibility="{StaticResource PhoneDarkThemeVisibility}"Source="/MyApplication;component/imageLightTheme.png" />
like image 68
robert_enough Avatar answered Nov 23 '22 18:11

robert_enough