1

I have a WP7 application that uses a dark image for the panorama's background. The issue is when the device is set to light theme i cant make it change with the lighter version of it.

private Color lightThemeBackground = Color.FromArgb(255, 255, 255, 255);
private Color darkThemeBackground = Color.FromArgb(255, 0, 0, 0); 

private void DisplayState()
{
    SolidColorBrush backgroundBrush =
         Application.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush;

    if (backgroundBrush.Color == lightThemeBackground)
    {
        PanoramaBackgroundImage = bg_light.png;
    }
    else
    {
        // you are in the dark theme
    }
}

and in the .xaml file I can't add the image (it only lets me define the panorama background once!

<controls:Panorama Title="Museo">
   <controls:Panorama.Background>
   <ImageBrush x:Name="PanoramaBackgroundImage" Stretch="Fill"
                 ImageSource="/Museo;component/bg_dark.png" />
</controls:Panorama.Background>

thanx

4

0 回答 0