【发布时间】:2010-02-22 23:02:36
【问题描述】:
Wpf 投影消失。 以下是如何重现。
在 xaml pad 中键入以下内容。
<Page.Resources>
<DropShadowEffect x:Key="shadow"
Opacity="1"
ShadowDepth="1"
Color="Blue"
BlurRadius="30"/>
</Page.Resources>
<Grid>
<Button HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Bd"
BorderBrush="Black" BorderThickness="1"
Background="Yellow"
CornerRadius="8"
Effect="{StaticResource shadow}">
<TextBlock Text="Hello out there" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Button.Style>
</Button>
</Grid>
您应该会看到一些带有边框的文本,并且边框周围有一个阴影。
现在将 Margin="0,0,0,0" 更改为 Margin="0,300,0,0",并调整 xaml pad 窗口的大小,以便可以看到边界。在我的机器上,阴影现在消失了。
还有人看到这个吗?请帮忙。
【问题讨论】:
标签: wpf dropshadow