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

3 comments:

  1. Thanks for sharing / publishing this tutorial - do you intent to post the souce code for this example?

    cheers, Christian

    ReplyDelete
  2. Sure, you can download the Silverlight 3 source that I used here:

    http://www.wintellect.com/CS/files/folders/sample_files/entry13316.aspx

    ReplyDelete
  3. Thank you very much for the post. It is very useful and clear. In fact, I had a lot of problems when I tried to use Commands in Silverlight 4

    ReplyDelete