1
我遵循了这个问题描述的方法属性值保持不变:Highlighting cells in WPF DataGrid when the bound value changesWPF动画没有得到触发时
<Style x:Key="ChangedCellStyle" TargetType="DataGridCell">
<Style.Triggers>
<EventTrigger RoutedEvent="Binding.TargetUpdated">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Duration="00:00:15"
Storyboard.TargetProperty=
"(DataGridCell.Background).(SolidColorBrush.Color)"
From="Yellow" To="Transparent" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Style.Triggers>
</Style>
<DataGridTextColumn Header="Status"
Binding="{Binding Path=Status, NotifyOnTargetUpdated=True}"
CellStyle="{StaticResource ChangedCellStyle}" />
我现在面临的问题是,动画isin't得到触发,当基本属性值不会改变。在上面给出的例子中,如果“状态”属性的值没有改变,那么动画不会被触发。有没有办法,我可以触发动画,而不管值是否变化。
谢谢。