【问题标题】:How to update/refresh a ListView in Xaml (windows 8 app) manually?如何手动更新/刷新 Xaml(Windows 8 应用程序)中的 ListView?
【发布时间】:2014-10-21 00:24:58
【问题描述】:

我需要在我的应用程序中刷新/更新 ListView。由于在我的情况下使用 INotifyPropertyChanged 没有用,有没有办法做到这一点?我在 WPF 中看到了对此的解释,但它们不起作用。

到目前为止我尝试了什么:

this.itemListView.Update();
this.itemListView.Items.Update();
this.itemListView.Refresh();
this.itemListView.Items.Refresh();

this.itemListView.UpdateLayout();

它们都不起作用。

最后一个也没有工作,即使它应该是,因为它存在。

【问题讨论】:

    标签: c# xaml listview microsoft-metro windows-8.1


    【解决方案1】:

    解决方案是重置我的 ItemSource:

    itemListView.ItemsSource = group.Items
    

    【讨论】:

      【解决方案2】:

      我正在经历同样的事情, 我试图取消 ItemsSource 并再次分配它, 类似:

      itemListView.ItemsSource = null;
      itemListView.ItemsSource = group.Items;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-08-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多