例如,如果我的边框有这样的样式:
<Border>
<Border.Background>
<SolidColorBrush />
</Border.Background>
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<DataTrigger Binding="{Binding StatusCode}"
Value="Status1">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
From="Transparent"
To="Red"
Duration="0:0:0.9"
DecelerationRatio="0.1"
AccelerationRatio="0.9"
AutoReverse="False"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
</Border>
有没有办法将数据触发器中的所有内容移动到模板中?