I have an image control in WPF form. When the image is not loaded. I want to make it dark gray, but all controls have a different background than the Image control.
Does anyone know how I can set the background for image management in XAML?
You can simply surround your image with a border:
<Border Height="300" Width="300" Background="Gray"> <Image Stretch="Fill" /> </Border>
Here is how I do it: use PNG file as background
<Image Source="Background.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
Source: https://habr.com/ru/post/1343461/More articles:MVC 3 Razor EditorTemplate / DisplayTemplate master page - asp.net-mvc-3Insert into two tables with C # and MySQL - c #Automatic version update using Vim; without SVN, I use Git - gitUsing emptiness as syntactic sugar to protect against implicit globals, yes or no? - javascriptC # dependency injection - c #C / C ++ sound library for musical instruments where you can manipulate audio data - c ++how to determine available physical memory in Linux - linuxXsd2java tools? - javadebugging HTTP requests in chrome - debuggingPython operations list - pythonAll Articles