你好,
可以写一个类来实现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内容请搜索靠谱客的其他文章。
发表评论 取消回复