Hello,
In this case, just after you have dismissed the first splash screen present the second one. Then when you dismiss the second splash screen, present the main screen. To ensure that these operations are performed with right order, you will implement a kind of state machine. The simplest is to evaluate for this purpose the class of the actually shown dialog. If it is the class of the first splash screen, then you can present the second screen. If it belongs to the second splash screen, then you present the main screen.
For this purpose modify the step 4 as follows:
// Determine the previously presented splash dialog
var Core::Group theCurrentDialog = FindCurrentDialog();
// Is the actually shown dialog the first splash screen?
if ((Application::splashScreen)theCurrentDialog != null )
{
// In such case hide it ...
DismissDialog( theCurrentDialog, null, null, null, null, null, false );
// create the second splash screen dialog and ...
var Core::Group splashscreen = new Application::splashScreen2;
// ... present it
PresentDialog( splashscreen, null, null, null, null, null, null, null, null, false );
// Restart the timer to hide the second splash screen
splashTimer.Enabled = true;
}
// Is the actually shown dialog the second splash screen
else if ((Application::splashScreen2)theCurrentDialog != null )
{
// Hide it ...
DismissDialog( theCurrentDialog, null, null, null, null, null, false );
// Create the main screen dialog
var Core::Group mainscreen = new Application::MainScreen;
// ... and present it
PresentDialog( mainscreen, null, null, null, null, null, null, null, null, false );
}
If the both splash screens do perform some transitions during their present/dismiss operation, these transitions are executed consequently one after another. If you want that the second splash screen performs its present transition simultanously while the first screen performs the dismiss transition, change the last parameter in the invocation of PresentDialog() when you present the second screen to the value true. See also: Perform several Dialog transitions simultaneously.
[...]
// In such case hide it ...
DismissDialog( theCurrentDialog, null, null, null, null, null, false );
// create the second splash screen dialog and ...
var Core::Group splashscreen = new Application::splashScreen2;
// ... present it. Note the specified transition and the value 'true' in the last parameter
PresentDialog( splashscreen, Effects::FadeInOutCentered, null, null, null, null, null, null,
null, true );
[...]
Does it help you?
Best regards
Paul Banach