You don't need to create separate DataTrigger entries here. You should have the same DataTrigger for both the
EnterActions
and the
ExitActions
.
<Border Grid.Row="4" Grid.ColumnSpan="2" BorderThickness="1" Width="140" Height="12" CornerRadius="10" Background="{Binding Machine59.StatusColor}" >
<Border.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding Machine59.HasError}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard x:Name="story59_1">
<Storyboard>
<DoubleAnimation
Storyboard.TargetProperty="Opacity"
From="1" To="0"
Duration="0:0:0.5"
AutoReverse="True"
RepeatBehavior="Forever"/>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="story59_1"/>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
</Border>