Creating a Custom Silverlight Pre-Loader
I have been doing Silverlight development since it was released. One question I get asked a lot is how do to create a custom pre-loader for my application. What do I mean by pre-loader? Well, it can be called many things; it could be called a pre-loader, splash screen, or a loading screen. No matter what you want to call it, here is the one you get by default.
I thought creating a custom pre-loader was common knowledge, but I guess I was wrong. So, what is a custom pre-loader really? Well, it is a small and lightweight Silverlight application that runs while your main Silverlight application is being downloaded to the client. Creating your own is really easy and only involves a few basic steps.
The XAML file is where you will create your pre-loader UI. So lets create a simple UI.
I actually copied this XAML from MSDN because I was to lazy to write my own.
- splashscreensource: The URI of a XAML page that displays while the primary package (source) is being downloaded.
You will need to add two Object Params to your page hosting the Silverlight application.
Now in order to test this thing, you need to add something very big to your main Silverlight application, set its Build Action to Content, and set Copy to Output Directory to Copy if newer. I added a video file that was about 100MB in size. Now run your application.
And there is our custom pre-loader.
For more information on creating custom pre-loaders visit http://msdn.microsoft.com/en-us/library/cc838130(VS.95).aspx