WPF 添加阴影效果

WPF最常见的一个阴影效果的类是DropShadowEffect,常用用的属性如下:
Color:设置颜色,默认为黑色
Direction:设置投影的方向(0-360),为0时阴影在正右方,逆时针增加,默认为315(右下方)
ShadowDepth:设置投影距纹理的距离,为0时周围添加晕彩
Opacity:设置透明度,1为完全不透明,0为完全透明
BlurRadius:模糊阴影,默认为5

模糊效果的类BlurEffect,可以设置Radius模糊效果曲线的半径,KernelType计算模糊的曲线的值等等:

<TextBlock Text="Hello world" Foreground="Green" HorizontalAlignment="Center" Margin="20" FontSize="36">
    <TextBlock.Effect>
        <BlurEffect Radius="4" KernelType="Box" />
    </TextBlock.Effect>
</TextBlock>