tags:

views:

50

answers:

2

I used this example to make the screen blur to focus attention. http://blog.wpfwonderland.com/2010/03/23/use-the-wpf-blur-effect-to-focus-attention/

I wanted the whole thing to grey out too, except only one user-control is graying out. I have a grid with 2 columns, left column is a tab control styled like outlook sidebar, and the right column is the main view. The main view grays out, the sidebar does not. Why? Is it because if the styles applied? The code is in the code behind of the main form that holds everything.

+1  A: 

It sounds like you're just not applying the BlurEffect to the correct element. It needs to be on the outermost container the contents of which you want blurred. In this case, perhaps the Grid itself.

<Grid>
    <Grid.Effect>
        <BlurEffect Radius="0" />
    </Grid.Effect>

I always use animations with the BlurEffect, so the storyboards that increase and decrease the radius and the triggers that start the storyboards all reside in Resources and Triggers collections.

Jay
No it actually blurs everything, just doesn't make everything gray. I want to use animations but I'm not sure I get them yet...plus no Blend.
nportelli
+2  A: 

It is probably because other control styles on the page have the Background property defined, and that code only changes the Window background (so the Window background is behind the other control backgrounds).

In the past I've used a Rectangle object positioned between the Controls on the page and the Popup, and set the background of the rectangle to something transparent. There's probably better ways out there though.

Rachel
Ya this is what I kind of figured. But the weird part is one section grays out. I thought about adding a covering rectangle but seemed janky. Yet trying to figure out all area's that need to be grayed seems like too much work.
nportelli
Some controls default to a transparent background if no background color is defined. That could be why one section does gray out properly.
Rachel
Ahh. Makes sense. Cool thanks.
nportelli
Can you give a quick hint on how to make a Rectangle appear on top of everything? I don't know how to put it under the popup window but on top of everything else.
nportelli
I built mine into the popup window. Both the popup and the rectangle were on a Canvas that had its height/width bound to the parent window size.
Rachel