Splash Screens for Silverlight

I finally have a few minutes this evening to discuss Silverlight Splash Pages. From creating my few Silverlight pages, I've noticed, you can quickly create a Silverlight .Xap file that becomes big. There are ways around that, which I'm still trying to look at, but lets first assume you can't. As you may know, when you bring up a Silverlight Control, the browser must download a .XAP file. If this .Xap file takes over 500 milliseconds to load, the default Silverlight loading control will show up. This isn't bad, but at times, you might want the screen to do something else.

When your doing your Development, I've learned that once this .xap downloads, its just like any other resource. If you want the loading screen to come up again, you will probably need to delete your Internet Files.

Here is my example: http://silverlightsplashpage.richardwysocki.com/ This is provided to you as a download on my Website in the Project Library section.

If your looking for the Microsoft Link on Silverlight Splash Screens, check this out: http://msdn.microsoft.com/en-us/library/cc838130(VS.95).aspx

In my Sample Application, I provide 2 fairly easy projects. One is a Web Application and the second one is a Silverlight Application. The Web Application has a Deafult.aspx page with 1 Silverlight control. In this control, you will see the following Text

Silverlight ID="Xaml1"
runat="server"
Source="~/ClientBin/Development.xap"
MinimumVersion="2.0.31005.0"
Width="100%"
Height="100%"
OnPluginSourceDownloadProgressChanged="onSourceDownloadProgressChanged"
SplashScreenSource="~/ClientBin/SplashPage.xaml"

The biggest change are the 2 properties OnPluginSourceDownloadProgressChanged and SplashScreenSource. You must create this SplashScreenSource .xaml file outside of the Silverlight application. The onSourceDownloadProgressChanged property is then created in the Default page. See it here:



So while the .xap file is downloaded, the xaml file is showed and the onSourceDownloadProgressChanged javascript function is called back to update the progress.

If there are issues in creating your own Silverlight Splash screen, its that your going back to Javascript files and when an issue comes up, good luck debugging it. I just love it.

But, I have to admit, I think its important to remove the default silverlight loading control. It just doesn't look good to have a really nice screen come up and then you have some generic loading icon come up. I just started this process after I've created another Silverlight page. Now when I bring up that one, I see the generic loading screen and then it pops up. This is all wrapped around a nice HTML page so it just doesn't look nice.

Good luck. Let me know if you have issues with the sample application. I hope you like the quick sample.

Comments

Popular posts from this blog

Intro to MongoDB

Starting our .NET Core WebAPI Journey – Step 2