Upgrading existing Silverlight 2 beta 1 code to beta 2

by APIJunkie 12. June 2008 05:59

Silverlight girl and I recently upgraded Bumble Beegger to work with Silverlight 2 beta 2.

Some things were easier then others all in all it took a few hours to finish and was not a big ordeal.

If you are planning on upgrading your code you can find official Microsoft documentation about breaking changes between beta 1 and beta 2 here. Also note that the last minute correction and additions can be found here.

Below are some of the coding issues we encountered and how we solved them in the hope that this will save someone else some time:

1. FrameworkElement.Resources is a ResourceDictionary

Trying to a use Add without a key fails.

Example:

canvas.Resources.Add(value); // compilation error on beta 2

canvas.Resources.Add("key",value); // o.k. on beta 2
 

2. WebClient reference change

To use web client you will need to add a reference to System.net.
 

3. ApplicationSettings.Default was changed

ApplicationSettings.Default is not accessible you can use IsolatedStorageSettings.ApplicationSettings instead.


4. The type or namespace name 'DataGrid' does not exist in the namespace

You can find more info about this problem and the solution here


5. DataGrid syntax changes.

Example:

DataGridTextBoxColumn was changed to DataGridTextColumn

You can find more info about it here.
 

6. SetValue needs explicit cast to double.

Example:

item.SetValue(Canvas.LeftProperty, value); // compilation error on beta 2

item.SetValue(Canvas.LeftProperty, (double)value); // o.k. on beta 2
 

 

Tags:

Silverlight | Troubleshoot

Comments

6/12/2008 6:34:03 AM #

trackback

Trackback from DotNetKicks.com

Upgrading existing Silverlight 2 beta 1 code to beta 2

DotNetKicks.com

6/12/2008 11:05:30 AM #

trackback

Trackback from Community Blogs

Silverlight Cream for June 12, 2008 -- #298

Community Blogs

6/14/2008 7:12:57 AM #

EMAN

I found an issue while playing the game (btw, I'm currently the high score ;) ). I don't know if this can be attributed to game lag but one of the times I had completed a stage and while the score was being calculated, I was still able to move the bee and lost a live. The weird thing was that the next stage hadn't even started yet. Anyways, just wanted to let you know.

EMAN United States

6/14/2008 7:13:49 AM #

EMAN

Oops, forgot to say nice job guys!

EMAN United States

6/15/2008 11:01:45 PM #

APIJunkie

Hi EMAN,

Thank you for your comments. We are glad you enjoyed the game Smile
You should not be able to move while the score is calculated.
In any case I will take a second look at the code and retest it, just to make sure.

-JB

APIJunkie United States

Comments are closed

About the author

Name of author

I was first wounded by x86 assembly, recovered and moved on to C. Following a long addiction to C++ and a short stint at rehab I decided to switch to a healthier addiction so I am now happily sniffing .NET and getting hooked on Silverlight.

I am mainly here to ramble about coding, various API’s, Junkies(me especially) and everything else that happens between coders and their significant other.

  James Bacon