在WPF中刷新XAML页面时出现问题 [英] Problem refreshing a xaml page in wpf

查看:145
本文介绍了在WPF中刷新XAML页面时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个wpf表格,在程序运行期间,我正在其中重新加载网格. (不是gridview-是wpf的)网格正在重新加载,但是显示了旧项目.当您返回并再次进入时,将显示新项目.

是否有类似于this.refresh dataGrid.Items.Refresh() CollectionViewSource.GetDefaultView(yourGrid.ItemsSource).Refresh();
的内容 我尝试了一切.需要任何帮助吗?

I have a wpf form in which during the running of the program, I am reloading a grid. (Not a gridview - the ones of wpf) The grid is reloading ok but the old items are shown. When you go back and go in to it again the new items are shown.

Is there something similar to this.refresh or dataGrid.Items.Refresh() or CollectionViewSource.GetDefaultView(yourGrid.ItemsSource).Refresh();
i tried everything. pls any help?

推荐答案

取决于大学项目的设计方式,您可能必须重新绑定数据源.

如果集合中的项继承INotifyPropertyChanged,则网格将自动更新.
Depending on how your colleciton items are designed, you may have to rebind your data source.

If the items in the collection inherit INotifyPropertyChanged, the grid will automatically update.


这篇关于在WPF中刷新XAML页面时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆