It's not necessary to set Storyboard.TargetName in storyboard, you can use it like: <ColorAnimation Storyboard.TargetProperty="Foreground.(SolidColorBrush.Color)" From="DarkOrange" To="SteelBlue" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever" />
. I used TextBlock.Loaded
to replace Binding.TargetUpdated
for testing, and it works. The below is the my edited aniTextBlock style:
<Style x:Key="aniTextBlock" TargetType="TextBlock">
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="Gray" />
</Setter.Value>
</Setter>
<Style.Triggers>
<EventTrigger RoutedEvent="TextBlock.Loaded">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="Foreground.(SolidColorBrush.Color)" From="DarkOrange" To="SteelBlue" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.