I have a StatusBar
TextBlock
item. This show the process being under taken and status/information messages. If the message is not 'Ready' I want the text to fade away over time, leaving 'Ready' when it has gone.
I currently am testing this, and have the following XAML for the TextBlock
.
<StatusBarItem DockPanel.Dock="Left" Margin="0,2,0,0">
<TextBlock Text="{Binding StatusMessage}"
Margin="5,0,0,0"
Foreground="White">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding SystemIsReady,
NotifyOnSourceUpdated=True,
Mode=TwoWay}"
Value="False">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
From="1.0"
To="0.5"
Duration="0:0:1.5"/>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding SystemIsReady,
NotifyOnSourceUpdated=True,
Mode=TwoWay}"
Value="True">
<Setter Property="Opacity" Value="1.0"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StatusBarItem>
The test method changes the text and updates the IsSytemReady
if the status is equal to 'Ready'. The binding are working but the animation to fade to 0.5 opacity seems to have fired before the application is shown and the trigger to set this Opacity back to one is also not working.
Why is the animation/trigger not re-firing?
Thanks for your time.