Jean Tehhe
Jean Tehhe

Reputation: 1357

GridSplitter drop shadow are not applicable

I use the following Xaml for GridSplitter and I wanted to add a drop shadow effect to it, but currently nothing happens. Any idea about what I'm missing here?

<GridSplitter ResizeDirection="Rows"
              Width="700"
              Height="4px"
              HorizontalAlignment="Stretch"
              VerticalAlignment="Bottom"
              Background="#d9d9d9"
              Margin="0,0,0,0">
    <GridSplitter.Effect>
        <DropShadowEffect ShadowDepth="3"
                          Opacity="3"
                          Color="Black" />
    </GridSplitter.Effect>
</GridSplitter>

Upvotes: 0

Views: 205

Answers (1)

user1608721
user1608721

Reputation: 158

I assume that the margin must be more than 0 in order to have space where to draw the shadow...

Consider also using of BlurRadius if applicable.

Following XAML Snippet drops shadow as expected...

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        Width="525"
        Height="350">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <GridSplitter Grid.Row="3"
                      Width="700"
                      Height="10"
                      Margin="30"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Bottom"
                      Background="#d9d9d9"
                      ResizeDirection="Rows">
            <GridSplitter.Effect>
                <DropShadowEffect BlurRadius="3"
                                  Opacity="3"
                                  ShadowDepth="3"
                                  Color="Black" />
            </GridSplitter.Effect>

        </GridSplitter>

    </Grid>
   </Window>

Have a nice day!

Upvotes: 1

Related Questions