I have created a DataGridCellTemplate where I have an Image control. By default it’s Source property is X. I fill DataGrid with objects of my own class (have also implemented INotifyPropertyChanged interface).
I would like to change Source property of Image control when some boolean variable changes from False to True.
Should I use a trigger? If yes, how? Or maybe it should be done in c# code?
I could make 2 image controls, bind and control their Visible property, but it’s lame solution I think.
Would appreciate any help.
In your DataTemplate try the following:
Where BooleanProperty is the property that triggers the source-shift. Note that the Image must have a name – and that should be used in the Setter-tag. In the example – I change the source from ‘X’ to ‘Y’
Hope this helps!