我有一类细胞看起来像这样:绑定颜色Solidbrush.color在C#代码
public Color color{get { return colorr; }
set { colorr = value;
if (this.PropertyChanged != null){
this.PropertyChanged(this, new PropertyChangedEventArgs("color"));
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
林增添了不少“细胞”的的的的Viewport3D生成多维数据集。随着时间的推移,细胞的颜色会发生变化。所以我的问题是 - 不是每次更改时重绘单元格,我可以将单元格的颜色绑定到代码中的solidbrush上吗?
我有这样的事情,但它不会工作。
Binding b = new Binding();
b.Source = cell.color;
SolidColorBrush solidBrush = new SolidColorBrush();
BindingOperations.SetBinding(solidBrush, SolidColorBrush.ColorProperty, b);
Material material = new DiffuseMaterial(solidBrush);
我现在假设solidBrush的颜色会改变,当细胞的颜色变化,因此立方体上的Viewport3D的颜色发生变化。但它没有。
感谢 - 大卫
如何在发布之前正确格式化代码? (注意:当前状态*不能*满足该属性) –