This is my code:
<Style x:Key="BackgroundStyle" TargetType="{x:Type Window}">
<Setter Property="Background">
<Setter.Value>
<VisualBrush Viewbox="0, 0,1280,1024" ViewboxUnits="Absolute" >
<VisualBrush.Visual>
<Image Source="Images\myImage.png">
<Image.Effect>
<BlurEffect Radius="20"/>
</Image.Effect>
</Image>
</VisualBrush.Visual>
</VisualBrush>
</Setter.Value>
</Setter>
</Style>
I want the window that has this style to have the myImage.png image as a background, which would be blurred and over that image there should be a layer of solid white color which would have an opacity of 0.8 With the code I have above, the image is set as background and it's blurred, but I don't know how to set a white color on top of the image.
It should look something like this:
Just add a white Rectangle with an appropriate Opacity to the VisualBrush's Visual:
By setting the Grid's
ClipToBounds
property, you may also get rid of theViewbox
settings: