在WPF中,如何刷新用户控件? [英] In WPF, how do I refresh a User Control?

查看:119
本文介绍了在WPF中,如何刷新用户控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了UIElement.InvalidateVisual但它没有用。





我正在尝试刷新组合框和数据我的用户控件的网格。显然,我有2个用户控件,一个用于添加,更新和删除条目,另一个用于组合框的数据网格。如果我决定添加新条目,则必须使用我的新条目更新组合框。我正在使用Modern UI的List Page但是通过使用它,用户控件的构造函数只是在我调用它的那一刻被调用而且再也没有被调用过,因此禁止我刷新每个组合框和用户控件的内容

I tried UIElement.InvalidateVisual but it didn't work.


I'm trying to refresh the combo boxes and data grids of my user controls. Apparently, I have 2 user controls, one for adding, updating, and deleting an entry and one for data grids with combo box. If I decided to add a new entry, the combo box must be updated with my new entry. I'm using Modern UI's List Page but by using this, the user control's constructor is just being called the moment I called it and never ever again being called, thus prohibiting me to refresh the contents of each combo boxes and user controls

推荐答案

只需浏览以下链接

http://stackoverflow.com/questions/1901281/how-can-i-refresh-a-custom-wpf-user-control-代码隐藏



我希望它满足您的要求。
Just go through the following link
http://stackoverflow.com/questions/1901281/how-can-i-refresh-a-custom-wpf-user-control-from-code-behind

I hope that it satisfies your requirement.


这篇关于在WPF中,如何刷新用户控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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