代码如下
private ObservableCollection<string> fruits=new ObservableCollection<string>{"苹果","西瓜"}; ObservableCollection<string> Fruits{ get{ return fruits; } set{ value=fruits;RaisePropertyChanged(); } }
结果怎么调试在Xaml界面中都显示不出来,打了断点实际Fruits是有值的。
最后发现是属性少了个Public修饰。加上就好了。
标签:ObservableCollection,Xaml,绑定,Fruits,fruits,属性 From: https://www.cnblogs.com/follow-discoverer/p/16648681.html