使用 DialogCoordinator 时,Mahapps 中不显示不确定的进度条
Indeterminate Progress bar not displayed in Mahapps when using DialogCoordinator
当我尝试从 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 显示控件在那里,但栏不显示滚动球。有什么想法吗?
我能够解决问题。添加样式时我只漏了一行:
<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"/>
当我尝试从 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 显示控件在那里,但栏不显示滚动球。有什么想法吗?
我能够解决问题。添加样式时我只漏了一行:
<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"/>