每当绑定更新时,我都会尝试将 TextBlock 旋转 360 度。
从我读过的所有内容来看,以下内容应该可以工作,但是它没有任何效果。我究竟做错了什么?
<TextBlock VerticalAlignment="Center" Text="{Binding Total, NotifyOnTargetUpdated=True}">
<TextBlock.RenderTransform>
<RotateTransform x:Name="TotalSpinTransform" Angle="0"/>
</TextBlock.RenderTransform>
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Binding.TargetUpdated">
<EventTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="(TextBlock.RenderTransform).(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:0.2" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.EnterActions>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>