ObservableCollection WPF Binding Display Not Updating

前端 未结 1 594
遥遥无期
遥遥无期 2021-01-23 10:17

In setting up data binding for Observable Collection , under the following context: Implementing CollectionChanged Handler in XAML with WPF all bindings are working

相关标签:
1条回答
  • 2021-01-23 11:22

    Do you fire PropertyChanged when LbItems is set? It does not look that way. In the constructor, you call InitializeComponent first and then initialize the collection in LbItems = new ObservableCollection<string>();. I think that your collection is initialized "too late", because the binding will already have been processed. If you do not fire a property changed when LbItems is set then the binding will not be updated to actually bind to the collection.

    0 讨论(0)
提交回复
热议问题