gpt4 book ai didi

c# - 使用 C# 和 XAML 在 Windows Phone 8.1 应用程序中更新或刷新 Listview

转载 作者:行者123 更新时间:2023-11-30 14:27:56 25 4
gpt4 key购买 nike

ItemsSource 更新时,我需要刷新 ListView。我已在 XAML 文件中将 myListView 声明为 ListView 并使用以下代码片段将 myList 指定为 C# 代码中的项目源:

myListView.ItemsSource = myList;

现在,我的问题是,如何刷新 myListView

最佳答案

刷新是什么意思?如果您希望刷新 UI,您的 myList 必须是 ObservableCollection 类型并且您的类必须实现 INotifyPropertyChanged 接口(interface)。

看看这篇文章

https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged%28v=vs.110%29.aspx

关于c# - 使用 C# 和 XAML 在 Windows Phone 8.1 应用程序中更新或刷新 Listview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30763230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com