I have DataGrid with 5 columns. Value of some column depends on other columns. how to create this dependency? I have tried to implement this structure, which fills data grid. But it was not updated in the case when other cells were eddited.
public class ColorItem
{
// Constructor
/*
* ColorItem constructor
* Params: color name, color
*/
public ColorItem(string color_name, Color color)
{
ItemName = color_name;
RChanel = color.R;
GChanel = color.G;
BChanel = color.B;
}
// Item name
public string ItemName { get; set; }
// Item color (calculated item)
public Brush ItemColor { get { return new SolidColorBrush(Color.FromRgb(RChanel, GChanel, BChanel)); } }
// Item r chanel
public byte RChanel { get; set; }
// Item g chanel
public byte GChanel { get; set; }
// Item b chanel
public byte BChanel { get; set; }
}