当我的数据源发生变化时,如何更新ListView?

时间:2021-10-09 20:19:29

http://windowsclient.net/learn/video.aspx?v=108085

In that video, when I changes data source by add more data the list view doesn't update? Please help me!

在那个视频中,当我通过添加更多数据来更改数据源时,列表视图不会更新?请帮我!

1 个解决方案

#1


You should use an ObservableCollection (or any collection that implements INotifyCollectionChanged, really) as the data source for the ListView. This way any changes made to the collection will be reflected in the ListView.

您应该使用ObservableCollection(或任何实现INotifyCollectionChanged的集合)作为ListView的数据源。这样,对集合所做的任何更改都将反映在ListView中。

#1


You should use an ObservableCollection (or any collection that implements INotifyCollectionChanged, really) as the data source for the ListView. This way any changes made to the collection will be reflected in the ListView.

您应该使用ObservableCollection(或任何实现INotifyCollectionChanged的集合)作为ListView的数据源。这样,对集合所做的任何更改都将反映在ListView中。