我是wpf和prism的新手。我创建了一个包含进度条的启动窗口,它在后台工作者中的值从 0 到 100。我不知道在哪里显示初始屏幕并关闭它。
我试图在解决外壳之前显示飞溅,但最终导致飞溅和外壳一起打开,也不知道在哪里关闭飞溅。
protected override Window CreateShell()
{
Views.SplashScreen splashScreen = new Views.SplashScreen();
splashScreen.Show();
return Container.Resolve<Shell>();
}
谢谢。
正如其他地方所写的,InitializeModules
是处理初始屏幕的好方法:
internal class App : PrismApplication
{
// [...]
protected override void InitializeModules()
{
var splashScreen = new SplashScreen( "myLogo.png" );
splashScreen.Show( false );
try
{
base.InitializeModules();
}
finally
{
splashScreen.Close( TimeSpan.Zero );
}
}
}