views:

80

answers:

1

I have ListView with binding on ObservableCollection which has INotifyPropertyChanged implemented. When user open window, data will be displayed but I want to change backgorund on cells where data was changed in meanwhile...

I have been trying with Data triggers, but they can be triggered just on certain values. I want to trigger when value changes, whatever value is.

Thanks

A: 

You can use DataTrigger for that. But you need to add corresponding IsDirty property to the ViewModel class and on the setter of your property you can check whether Data has been modified and fire the IsDirty. Which inturn fire DataTrigger and so the background. For example if you got a FirstName property, you might need IsFirstNameDirty:bool There is no other easy way the WPF checks for your value changed from the intial one.

Jobi Joy