In this post I will show you how to create the custom splash screen for your Silverlight application. You have seen many software which use nice splash screen during loading of the software applications like Microsoft office, excel and many others. I have also created splash screen for my desktop applications which I have developed during my professional life. But I didn’t created any for the web application which I have developed in asp.net. But now the Silverlight provide the functionality of the splash screen. Splash screens provide something interesting and creative to increase anticipation and excitement for the application.
The splash screen is displayed while the .xap file is downloading when the .xap file is downloaded the splash screen disappear. So xaml file for the splash screen is not included in the Silverlight application rather the splash screen file which is of xaml is placed in the web application. When Silverlight application start the default splash screen which you can see is the shown in the image 1. Here you can see the spinning blue balls animation splash screen.
Let us start with the our own splash screen , the splash screen which I have created is shown in the Image 2. In Image 2 you can see that I have created simple splash screen for my application which will show the percentage complete in digits so that user can see how much the application is downloaded.
The code for the splash screen which is written in the file SilverlightLoader.xaml is place in the web project which you can see after downloading the source code. The code consist of the grid layout and then Border and the textblock which will shown the download complete in percentage. I have also set drop shadow effect for the border which contain the text block control.
The next step is to integrate the custom splash screen with the web application. You can see in the List 1 splashScreenSource property is used to reference the splash screen. By using this property, you can point to where a custom splash screen’s XAML is stored.
Hope you get idea of how to integrate the custom splash screen with the silverlight application. I have created simple splash screen you can create animations during the download progress.
Note: As I have used the control of silverlight application like border, grid and text block I have added the reference of the PresentationCore and PresentationFramework in my web application.
I have not not included the silverlight application in the source project. As I was testing the output locally so I have embed large image files in the silverlight application so that size of the .xap file will increase and it will take some time to download locally.