Click here to Skip to main content
13,199,852 members (68,579 online)
Click here to Skip to main content
Add your own
alternative version


48 bookmarked
Posted 22 Nov 2010

15 Things I've Discovered about Silverlight

, 6 Jan 2011
Rate this:
Please Sign up or sign in to vote.
Here is a list of 15 things I've discovered about Silverlight

I love Silverlight and have written / talked about it a lot. I can't help but notice that a lot of people are new to Silverlight or may have played with it a few times. Well, this post is for you. It is a list of 15 things that I've discovered since I started developing for Silverlight. If you are a full-time Silverlight developer, then I would hope you know most of these. I promise not to scare off anyone with talks of MVVM, Prism or MEF.

  1. The line highlighted below represents the MIME type and it is not the runtime version of Silverlight. Many developers are at first confused about this because they think it is referring to the Silverlight version (example: Silverlight 4).

    HTML/ASPX markup of a Silverlight Hosted Application


  2. You can't use .GIF images with Silverlight. Use .PNG files if you need images in a Silverlight application. If you must use .gifs, then you should consider using the .NET Image Tools Library for Silverlight. Many people are also building web services that will convert the .gif files to .PNG. I would recommend converting the images to .PNG with a tool like Paint.NET.


  3. If a user does not have the Silverlight 4 plug-in installed, users are prompted to download it by the following line of code (found inside the .ASPX or HTML file):


    If you change the link to:

    <a href="" 
    	style="text-decoration: none;">
        <img src="" 
    	alt="Get Microsoft Silverlight" style="border-style: none"/>

    Then it will always download the latest version of the Silverlight runtime. New versions are backward compatible with old versions of the runtime.

  4. All data access in Silverlight is asynchronous. The example below will not work:
    MyOldWebService srv = new MyOldWebService();
    string strReturn = srv.GetSomeValue();
    txtValue.Text = strReturn;

    This is how we would call a WCF service in Silverlight (for example, after the InitializeComponent method):

    public MainPage()
        Service1Client client = new Service1Client();
        client.DoWorkCompleted += new EventHandler<DoWorkCompletedEventArgs>
    void client_DoWorkCompleted(object sender, DoWorkCompletedEventArgs e)
  5. Use templates / themes whenever necessary. Microsoft has provided 4 themes that will give your application a custom look. You can also use the built-in Navigation template included in VS2010 or the ones included in Blend 4 (which includes MVVM template). In other words, don't start a project completely from scratch unless you need too.



  6. Spend the time to learn Blend 4. Sure you can write all of your XAML (markup) from hand but why? Blend 4 was created to assist with creating applications for Silverlight, WPF and Windows Phone 7. I cannot imagine creating Storyboards and animations by hand. It has a learning curve but it is worth it in the end.


  7. Make use of the Silverlight Toolkit available on CodePlex.

    The Silverlight Toolkit is a collection of Silverlight controls, components and utilities made available outside the normal Silverlight release cycle. A product of the Microsoft Silverlight product team, the Silverlight Toolkit adds new functionality quickly for designers and developers, and provides the community an efficient way to help shape product development by contributing ideas and bug reports. It includes full open source code, unit tests, samples and documentation for over 26 new controls covering charting, styling, layout, and user input. – Taken from the codeplex site.


  8. Be aware that your Silverlight code can be viewed by anyone using tools like Silverlight Spy/.NET Reflector. If your application is on the internet and not an internal application, then you better obfuscate it. It's better to have some security than none. This also works the other way around and you can see how someone built a Silverlight application.


  9. The .XAP file that your Silverlight project creates is simply a .zip file with a different extension. You can use an external program like 7zip to squeeze a smaller file size than the one included with VS2010. It also pays to open up a .XAP file and examine what's included with your project.


  10. If a file is not necessary for every user, then do not include it in the .XAP file. I've heard every argument against this saying,” bandwidth is cheap.” However, this method really gets expensive when it's more than 50-100 images or other binaries. I only include the files absolutely necessary for every user of my application.
  11. You can host a Silverlight application in other servers. You do not have to use IIS. Simply setup the MIME type on your WebServer and the Silverlight application will work on the client as long as the Silverlight run-time is installed.


  12. The community rocks for Silverlight. There are a lot of ways to learn more about it. I'd start with the official Silverlight site, then check out the official forums. I'd also visit Silverlight Cream and Alvin’s Ashcraft’s Morning Dew daily. To finish up, I'd watch every episode of John Papa’s Silverlight TV.


  13. Once you learn XAML (the markup for Silverlight), you can use those skills to produce applications for the following platforms: Silverlight (duh), WPF, Windows Phone 7, Lightswitch and Surface.


  14. Silverlight works with all the major browsers (Google Chrome 6, Internet Explorer, Firefox and Safari) and Operating Systems (such as Windows and Mac OS). It even includes support for Linux through the Moonlight project.


  15. Users get the same experience no matter what browser they are running. Remember when one webpage worked fine in Firefox, but not in Internet Explorer 6. Since Silverlight is a plug-in, everyone gets the same experience.


Thank you for reading my blog post, as always feel free to subscribe to my feed or add me to twitter.

alt Subscribe to my feed


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Telerik
United States United States
Michael Crump is a Silverlight MVP and MCPD that has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

He has worked at Fortune 500 companies where he gained experience in embedded systems design and software development to systems administration and database programming, and everything in between.

His primary focus right now is developing healthcare software solutions using Microsoft .NET technologies. He prefers building infrastructure components, reusable shared libraries and helping companies define, develop and automate process standards and guidelines.

You can read his blog at: or follow him on Twitter at @mbcrump.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
walterhevedeich22-Sep-11 19:31
memberwalterhevedeich22-Sep-11 19:31 
GeneralMy vote of 5 Pin
jcBrasil8-Apr-11 7:05
memberjcBrasil8-Apr-11 7:05 
GeneralMy vote of 5 Pin
Mika Wendelius18-Feb-11 21:16
memberMika Wendelius18-Feb-11 21:16 
Generalthanks for sharing - have 5 Pin
Pranay Rana5-Jan-11 22:48
memberPranay Rana5-Jan-11 22:48 
GeneralMy vote of 5 Pin
Abhijit Jana5-Dec-10 6:31
mvpAbhijit Jana5-Dec-10 6:31 
GeneralGood info Pin
Vuyiswa Maseko5-Dec-10 2:06
memberVuyiswa Maseko5-Dec-10 2:06 
GeneralMy vote of 5 Pin
Vuyiswa Maseko5-Dec-10 2:05
memberVuyiswa Maseko5-Dec-10 2:05 
GeneralMy vote of 4 Pin
Omar200329-Nov-10 2:13
memberOmar200329-Nov-10 2:13 
GeneralThanks Pin
Omar200329-Nov-10 2:13
memberOmar200329-Nov-10 2:13 
GeneralMy vote of 5 Pin
Anurag Gandhi28-Nov-10 18:23
memberAnurag Gandhi28-Nov-10 18:23 
GeneralMy vote of 5 Pin
defwebserver22-Nov-10 17:38
memberdefwebserver22-Nov-10 17:38 
GeneralMy vote of 5 Pin
KunalChowdhury22-Nov-10 16:50
mentorKunalChowdhury22-Nov-10 16:50 
GeneralMy vote of 5 Pin
aspdotnetdev22-Nov-10 7:34
memberaspdotnetdev22-Nov-10 7:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171020.1 | Last Updated 6 Jan 2011
Article Copyright 2010 by mbcrump
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid