Thursday, April 15, 2010

Converting Silverlight 3 to Silverlight 4

In this video, I wanted to share just how quick and easy it is to convert a Silverlight 3 project to Silverlight 4.

The steps are basically as follows:

  • Make sure you have the Silverlight 4 tools
  • If you use Blend or any of the interactivity extensions (for triggers and behaviors) be sure to get the latest version of Blend
  • If you use the Toolkit, download and install the latest version of that as well
  • Open your project in Visual Studio 2010, then
    1. Right-click the Silverlight projects, go into properties and change to target Silverlight 4
    2. Delete any bad Toolkit or Blend references and re-add them to point to the current version
    3. If you used the MEF preview, the references should update automatically — delete any local copies of the DLLs you may have included in the project
    4. Compile and run: in most cases, you're done!

In this simple example, I not only converted the application, but took advantage of the fact that buttons support commanding and removed a trigger I created in order to bind the button directly. Enjoy!

Jeremy Likness