Highlighting cells in WPF DataGrid when the bound value changes

前端 未结 3 913
自闭症患者
自闭症患者 2021-01-01 21:42

I have a DataGrid that has its data refreshed by a background process every 15 seconds. If any of the data changes, I want to run an animation that highlights the cell with

3条回答
  •  臣服心动
    2021-01-01 22:18

    My ideas for point (1) would be to handle this in the code. One way would be to handle the TargetUpdated event for the DataGridTextColumn and do an extra check on the old value vs. the new value, and apply the style only if the values are different, and perhaps another way would be to create and remove the binding programmatically based on different events in your code (like initial load, refresh, etc).

提交回复
热议问题