Set the WP7 background image of panorama view from c# code
I want to change the background image for the panorama view in the WP7 from code.
First from XAML:-
<controls:Panorama Title="earth" Name="PanoObj">
<controls:Panorama.Background>
<ImageBrush ImageSource="background.jpg" />
</controls:Panorama.Background>
</controls:Panorama&开发者_运维问答gt;
From the code side it is done from:-
$this.PanoObj.Background //It accepts the type Brush.
I really dont understand this as from XAML it is an ImageBrush but in code it is Brush. Please help me how to fix this or convert from ImageBrush to Brush.
thanks,
An ImageBrush
is a Brush
see the inheritance hierarchy.
You shouldn't need to cast (or convert it).
精彩评论