Splash Screen Manager Serialization Specifics
- 2 minutes to read
A SplashScreenManager component is serialized differently depending on the selected Active Splash Form (the SplashScreenManager.ActiveSplashFormTypeInfo property).
The Active Splash Form is a Splash Screen or None
An instance of the SplashScreenManager class is declared as a local variable within your main form’s InitializeComponent method. This serialization approach ensures that a Splash Screen Manager is initialized before all other components, and the selected Splash Screen is launched at the very first moment your form starts. However, take note that you will not be able to address the local instance of the SplashScreenManager component that is declared within the InitializeComponent method.
Here are the methods you can use in this scenario.
- To manually open and close splash forms, use the static methods provided by the SplashScreenManager class.
- To interact with the currently displayed splash form, use non-static methods provided by the SplashScreenManager.Default object.
// Display a Wait Form SplashScreenManager.ShowForm(typeof(WaitForm2)); //... //Change its caption SplashScreenManager.Default.SetWaitFormCaption("new caption"); //... //Close the Wait Form SplashScreenManager.CloseForm();
The Active Splash Form is a Wait Form
An instance of the SplashScreenManager class is declared as a local variable of you form, outside the InitializeComponent method. In this case, you can open, close and interact with the selected Wait Form using a SplashScreenManager‘s non-static methods, accessible via the SplashScreenManager instance. These methods are: SplashScreenManager.ShowWaitForm, SplashScreenManager.CloseWaitForm, SplashScreenManager.SetWaitFormCaption, SplashScreenManager.SetWaitFormDescription and SplashScreenManager.SendCommand.