Hi folks,

Today we will see how to change the color or a row depending on the value of the content.

To do that, create a simple View:

The important thing here  are the DataTriggers. If a condition is met, it will apply a value to a property. For example, the first trigger is:

If the FirstName == “Dolores” Then the Foreground of the Row will be green.

Now go in the code behind of the View, and bind the DataContext of the View to your ViewModel (yes, we are using MVVM):

And finally, our ViewModel:

Happy coding!   🙂