I’m pretty new to WPF, so please understand if this question is too simple. What I’m trying to do is setting the background image for a MediaElement (which play as a container-box). I tried to set background image for a grid that contains it, but it doesn’t work. MediaElement doesn’t have background Image, too.
Is there any elegant way to make a background like that?
My MediaElement:
<MediaElement Name="mediaLessonImage" Grid.Column="1" Margin="50,78.01,7,159.99" Grid.Row="1"></MediaElement>
I will be thankful for any help.
UPDATE:
Based on Ioxxy answer, I have retrieve the solution (just a bit modification):
<Border Grid.Column="1" Margin="50,78.01,7,159.99" Grid.Row="1">
<Border.Background>
<ImageBrush ImageSource="BackImage.jpg" Stretch="Fill"/>
</Border.Background>
<MediaElement Name="mediaLessonImage" />
</Border>
Simply wrap it up in an element which supports background. For example:
By the way, if you replace Border with Grid, it will still work since Grid control supports Background property.