How to achieve shadow effect in Wpf

0

This is the effect I want to achieve

Pd: I have already tried with gradients but I do not get the desired effect.

<LinearGradientBrush StartPoint="0,0.1" EndPoint="1,0.10" Opacity=".4" >
 <GradientStop Color="#7c7c7c" Offset="0.0" />
 <GradientStop Color="#D1D1D1" Offset="0.040" />
 <GradientStop Color="#D1D1D1" Offset="0.10" />
 <GradientStop Color="#D1D1D1" Offset="1.0" />
</LinearGradientBrush> </Controls:Tile.Background>
    
asked by Hector Javier Tigua Guerrero 31.08.2017 в 22:53
source

1 answer

2

Use DropShadowEffect that creates a shadow on an element.

Here is an example of use:

                                           

    <Grid Grid.Column="0" Background="White" Panel.ZIndex="1">
        <Grid.Effect>
            <DropShadowEffect BlurRadius="3" RenderingBias="Quality" Color="#ccc" ShadowDepth="5" Direction="5" />
        </Grid.Effect>
    </Grid>

    <Grid Grid.Column="1" Background="#ccc"></Grid>
</Grid>

Result:

    
answered by 01.09.2017 в 04:00