Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set background to image control

I've an Image Control in a WPF Form. When there's no image loaded. I want to make it dark gray but all of the controls have the Background exept the Image control.

Does anybody knows how can I set a background to the image control in the XAML?

like image 804
Jaime Oro Avatar asked Mar 12 '11 18:03

Jaime Oro


1 Answers

You can just surround your image with border:

<Border Height="300" Width="300" Background="Gray">
    <Image Stretch="Fill" />
</Border>
like image 200
kyrylomyr Avatar answered Oct 03 '22 23:10

kyrylomyr