我在 wpf 中使用了以下 xaml:
<Style TargetType="{x:Type Border}">
<Setter Property="BitmapEffect">
<Setter.Value>
<BitmapEffectGroup>
<DropShadowBitmapEffect ShadowDepth="1"/>
</BitmapEffectGroup>
</Setter.Value>
</Setter>
</Style>
当我发现 DropShadowBitmapEffect 现在已被弃用以支持 DropShadowEffect 时:
<Style TargetType="{x:Type Border}">
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect></DropShadowEffect>
</Setter.Value>
</Setter>
</Style>
但我很幸运地知道这一点!!我怎么知道现在不推荐使用用 xaml 编写的某个控件?