我正在使用 Modern UI for WPF 开发桌面应用程序。当我转到新标签页时,我尝试刷新我的标签页,但我不能。
当我使用标签 Controller 转到另一个页面时,我想刷新我的 MUI WPF 标签页。
谁能帮帮我?
最佳答案
我不太清楚你的意思,但是通过在控件上调用 InvalidateVisual() ,你可以强制刷新它的视觉效果(如果你想要的话),因为听起来你有一个 WPF数据更改时未更新的控件。
基于MSDN documentation ,这个:
Invalidates the rendering of the element, and forces a complete new layout pass. OnRender is called after the layout cycle is completed.
例如:
var grid = new Grid();
// Our grid should refresh after this,
// although in normal circumstances it would by default regardless.
grid.InvalidateVisual();
希望对你有用。
关于c# - 选项卡更改时刷新/重新加载 MUI WPF 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22877919/