我是靠谱客的博主 无辜彩虹,这篇文章主要介绍checkbox wpf 绑定数组_WPF绑定数组的问题,现在分享给大家,希望可以做个参考。

你好,

可以写一个类来实现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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部