【发布时间】:2021-01-17 03:21:49
【问题描述】:
我的类库中有很多静态属性。我想用两种方式绑定网格中的属性值。怎么绑定呢?
public class AllStaticProperty
{
public static int JA{get;set;}
public static float JB{get;set;}
public static bool JC{get;set;}
public static int[] JD=new int[1000];
//More properties here
public static float[] ZZ=new float[2000];
}
我想绑定静态属性名称网格第一列字段,用户在网格第二列中输入属性值,然后返回以将值存储在静态属性中。如何绑定(我有超过 3000 个静态属性)
【问题讨论】:
-
AllStaticProperty 类需要实现 INotifyPropertyChanged 接口才能让自己的属性绑定到 UI
-
您想看到它们随着时间的推移而更新吗?还是“一次性”绑定?
标签: wpf data-binding datagridview datagrid