Hi Folks,
I'm trying to use WPF animation to creat an effect where, when the data in a text property changes, the text fades out, then in again.. or preferably a proper crossfade.
I have successfully got half of this working, the code below responds to the text changed event, immediately makes the text invisible then fades it in over 3 seconds.
To fade text out is similarly simple, I just change the From and To properties of the tag. BUT - the problem is that the text on the screen changes immediately. This is usually absolutely required, of course, but in this case I want the OLD text to fade out, then the NEW text to fade in.
Is there any clever trick to doing this in WPF animation?
Current half-finished trigger:
<Style TargetType="TextBlock" x:Key="fadeinout">
<Style.Triggers>
<EventTrigger RoutedEvent="Binding.TargetUpdated">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:3" From="0.0" To="1.0" BeginTime="0:0:0" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>