In WPF you can use an IValueConverter or IMultiValueConverter to convert a data-bound value from say an int to a Color.
I have a collection
You cannot set the converter on the collection itself, because it would get the collection as input. You have two choices:
If you want to use the second approach, then use something like this:
If you don't need a custom datatemplate, then you can skip the ContentTemplate attribute.