using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DatagridBackground.Models; using System.Windows.Data; using System.Windows.Media; namespace DatagridBackground.Datagrid { public class MyBkColorConverter2 : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Object obj = value; Type t = obj.GetType(); if (value is Model_Color) { Model_Color color = (Model_Color)value; return color.Color2; } return Brushes.Green; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }