【发布时间】:2010-06-04 00:12:12
【问题描述】:
我有一个 UserControl,在资源部分我有类似的代码
<Style TargetType="{x:Type Viewbox}">
<Style.Triggers>
<Trigger Property="Viewbox.IsMouseOver" Value="True">
<Setter Property="Viewbox.Effect" >
<Setter.Value>
<DropShadowEffect Color="DarkGray" Direction="45" BlurRadius="30"></DropShadowEffect>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
所以这适用于我在此控件中拥有的 ViewBox,
但是当我这样做时
<Viewbox.Triggers>
<Trigger Property="Viewbox.IsMouseOver" Value="True">
<Setter Property="Viewbox.Effect" >
<Setter.Value>
<DropShadowEffect></DropShadowEffect>
</Setter.Value>
</Setter>
</Trigger>
</Viewbox.Triggers>
在视图框中我收到错误....
有没有办法在不使用样式的情况下向 ViewBox 添加本地触发器?
【问题讨论】: