The Prism application I have performs multiple startup tasks that can take a while and if some of those tasks fail to execute properly it will make the application functiona
You have (at least) two options:
SplashScreen
Splashscreen example:
internal class MyBootstrapper
{
// [...]
protected override void InitializeModules()
{
var splashScreen = new SplashScreen( "myLogo.png" );
splashScreen.Show( false );
try
{
base.InitializeModules();
}
finally
{
splashScreen.Close( TimeSpan.Zero );
}
}
}
Tasks example:
internal class MyBootstrapper
{
// [...]
protected override void InitializeModules()
{
Task.Run( () => base.InitializeModules() );
}
}
with this, you have to be careful that some services might unexpectedly not be created on the ui thread (e.g. EventAggregator
) and those will behave strangely. If that happens, resolve them before kicking off the task that does the initialization.