Upgrading existing Silverlight 2 beta 1 code to beta 2

by APIJunkie 6/12/2008 5:59:00 AM

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
 

 

Currently rated 3.0 by 1 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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 Wink ). 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 us

6/14/2008 7:13:49 AM

EMAN

Oops, forgot to say nice job guys!

EMAN us

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 us

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

11/19/2008 9:34:15 PM

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author

My name is Bacon…James Bacon.

I am an API wars veteran I was wounded by x86 assembly, recovered and moved on to C. I am currently stuck in C++ and sniffing .NET.

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.

E-mail me Send mail


Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in