0

I have a window with a button. When you click the button popup appears. How can I darken the full screen when open popup?

sribin
  • 1,736
  • 1
  • 13
  • 21
  • Does this answer your question? [How do I darken all screen area and glow my opened window in WPF?](https://stackoverflow.com/questions/4520318/how-do-i-darken-all-screen-area-and-glow-my-opened-window-in-wpf) – StayOnTarget Feb 18 '20 at 12:39

3 Answers3

0

You should write your own shader in order to darken, lighten, engraying, moting blurring and doing other cool graphics stuff.

Of course, if you don't want it to do in a right way, you could just create an Rectangle with IsHitTestVisible = false property and black color and some 0.5f opacity all over your form, but...

AgentFire
  • 8,944
  • 8
  • 43
  • 90
0

This is called Adorner what you are looking for. Link here also might be of your interest.

Rohit Vats
  • 79,502
  • 12
  • 161
  • 185
0

One easy way to do this is to create a new UserControl like this:

<UserControl ...
<Grid Background="#AA000000"> <!-- control the overlay color here -->
        <Border Background="White" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="10">
            <TextBlock Text="content"/>
        </Border>
</Grid>
</UserControl>

Than just add it to the top grid of your window.

Leo
  • 7,379
  • 6
  • 28
  • 44