使用DialogCoordinator时,Mahapps中未显示“不确定进度”栏

本文关键字:不确定 不确定进度 显示 DialogCoordinator Mahapps 使用 | 更新日期: 2023-09-27 18:00:07

当我试图从ViewModel:调用mahapps进度对话框时

public async void Test()
{
    var controller =
        await
        this.dialogCoordinator.ShowProgressAsync(
            this, 
            "Progress from VM", 
            "Progressing all the things, wait 3 seconds");
    controller.SetIndeterminate();
    // await Task.Delay(3000);
    // await controller.CloseAsync();            
}

显示对话框,但滚动不确定进度不显示在对话框底部。使用Snoop监视XAML显示控件在那里,但条形图不显示滚动球。有什么想法吗?

使用DialogCoordinator时,Mahapps中未显示“不确定进度”栏

我解决了这个问题。我只是在添加样式时漏掉了一行:

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Baselight.xaml" />
<!-- missed the inclusion of accent color style, have own style for anything else so I didn't noticed that -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Clean/Clean.xaml"/>