c# - 选项卡更改时刷新/重新加载 MUI WPF 页面

标签 c# wpf xaml tabs modern-ui

我正在使用 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/

相关文章:

c# - 如何使用 DynamicResource 更新 SolidColorBrush 颜色?

c# - WPF slider 问题

wpf - xamdatetimeeditor 设置默认当前时间和日期

c# - WPF 数据绑定(bind)到复合类模式?

c# - 在 .NET 4.5 中找不到 HttpClient

c# - EventTrigger 中的模板绑定(bind)

c# - WPF XAML 绑定(bind)列表和组合框

c# - 如何获取被点击的 ListView 项目

c# - 将 List<T> 内容添加到 ConcurrentQueue<T> 的最快方法

c# - 用哈希表中的值替换占位符