1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <Style TargetType="DataGridCell" x:Key="Cell"> <Setter Property="Foreground" Value="Black"/> <Style.Triggers> <EventTrigger RoutedEvent="Binding.TargetUpdated"> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetProperty="Background.Color"From="OrangeRed" To="Transparent" Duration="0:0:1.5"/> </Storyboard> </BeginStoryboard> </EventTrigger> </Style.Triggers> </Style>
<DataGrid ItemsSource="{Binding DataSource}" Grid.Row="1" AutoGenerateColumns="False" > <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID,NotifyOnTargetUpdated=True}"/> <DataGridTextColumn Header="Name" Binding="{Binding Name,NotifyOnTargetUpdated=True}"/> <DataGridTextColumn Header="Price" Binding="{Binding Price,NotifyOnTargetUpdated=True}" CellStyle="{StaticResource Cell}"/> </DataGrid.Columns> </DataGrid>
|