Search code examples
wpfaero

Aero white glow in WPF?


How do I add the Aero white glow behind a control in WPF?
I mean the glow like in a window's caption bar in Vista/7.


Solution

  • This unrelated question seems to have the answer...
    Outer bevel effect on text in WPF

    I just needed a rectangle behind my text block...

        <Rectangle Height="{Binding ElementName=textBlock1, Path=ActualHeight}" HorizontalAlignment="{Binding ElementName=textBlock1, Path=HorizontalAlignment}" Margin="{Binding ElementName=textBlock1, Path=Margin}" VerticalAlignment="{Binding ElementName=textBlock1, Path=VerticalAlignment}" Width="{Binding ElementName=textBlock1, Path=ActualWidth}" Fill="White" Opacity="0.5">
            <Rectangle.Stroke>
                <SolidColorBrush />
            </Rectangle.Stroke>
            <Rectangle.Effect>
                <BlurEffect Radius="10" KernelType="Gaussian" />
            </Rectangle.Effect>
        </Rectangle>
    

    This is gonna do the trick for any control when you replace all the "textBlock"s in the code!
    And it looks exactly the same as the aero glow!