我为GridSplitter使用了下面的Xaml,我想给它添加一个下拉阴影效果,但是目前什么都没有发生。知道我在这里错过了什么吗?
<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>发布于 2014-03-04 11:53:36
我假设边缘必须大于0,这样才有空间绘制阴影.
如果适用,也考虑使用BlurRadius。
随着XAML片段像预期的那样投下阴影..。
<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>祝您今天愉快!
https://stackoverflow.com/questions/22170933
复制相似问题