Blur the background of the WPF container

后端 未结 4 1667
渐次进展
渐次进展 2020-12-16 17:09

Ultimately, what I want to achieve is a replication to some extend, of an Aero glass functionality of a WPF content control.

If I apply the BlurEffect t

4条回答
  •  我在风中等你
    2020-12-16 17:58

    What the background of the StackPanel? an ImageBrush? If so why cant you apply BlurEffect to that?

    If that is not possible then try this..

    1] Use an image and draw it completely over Grid as I see you dont want a TileEffect. Add BlurEffect to this Image. Make sure you fill image the uniformly.

    2] Then add StackPanel with transparent background as next child in the Grid i.e. dont reverse the order of image and stackpanel.

    3] Then add TextBlock in StackPanel.

    OR

    If you insist on using a Brush to be set as the backgrounnd of the panel then use VisualBrush that draws a blurred image as background of the stackpanel, instead of ImageBrush.

    Let me know if any of these tips help.

提交回复
热议问题