概述
你好,
可以写一个类来实现INotifyPropertyChanged 接口。 然后绑定就可以了,只要B变化了,WPF前端也会改变。
public class Test : INotifyPropertyChanged
{
private bool[] _b;
public bool[] B
{
get { return _b; }
set {
_b= value;
OnPropertyChanged("B");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName = "")
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
public Test ()
{
B= new bool[100];
}
}
纤细内容,请参考:
Best regards,
Zhanglong
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.
最后
以上就是无辜彩虹为你收集整理的checkbox wpf 绑定数组_WPF绑定数组的问题的全部内容,希望文章能够帮你解决checkbox wpf 绑定数组_WPF绑定数组的问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复