我正在开发wpf应用程序。我在C#中有一个颜色对象的实例。假设我有一个红色对象的实例,也就是Color c = Color.FromArgb(255,255,0,0),现在假设我有一个从1到10的值,所以我想根据这个值改变'c‘对象的颜色。我想要1的浅红色和10的深红色。当数值从1增加时,浅红色变成深色。我如何在wpf应用程序的C#中做到这一点?您能提供给我任何代码或链接,我可以通过它来解决上述问题吗?
这就是我想要完成的: DataGridd上的绑定集合包含RowModel的实例,如下所示(为简单起见被最小化),然后RowModel可以包含ValidationClass的实例。
public class RowModel
{
public int RowId { get; set; }
public string Column1 { get; set; }
public string Column2 { get; set; }
public string Column3 { get; set; }
public ICollection<Valid
如何使用mvvm启用/禁用数据框架内的按钮,其中列状态等于c#中的某些值?
谢谢。
我是mvvm和wpf的新手。
编辑:
我的代码只打印数据中的数据。当列状态等于1时,我想禁用编辑按钮。
你可以在下面看到我的代码。
模型文件
public class Reestr
{
private int id;
private string date;
private string market;
private int status;
public int Id
{
get { return id; }
set {