In the converter you can then determine what brushes to return based on the current progress:
public class ProgressToBackgroundBrushConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var progress = double.Parse(value.ToString());
if (progress < 20)
{
return Brushes.Red;
}
return Brushes.Green;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
I've prepared a small sample project to demonstrate this in action.
Please have a look and let me know if such an approach would work for you.
Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.