First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« Measuring Satisfaction - We are a Nielse... | Main | Unit Testing Silverlight with Selenium »

I am by no means a Silverlight expert. That said, here's the things I personally needed to do to update an existing Silverlight 1.1 Alpha project to Silverlight 1.1 Alpha Refresh.

First, I loaded up my existing Visual Studio 2005 project in Visual Studio 2008 Beta 2 and went through the conversion wizard. No warnings, no errors, but the wizard won't touch your JavaScript.

Next, I add a FRESH New Silverlight Project to my solution. I added this project for reference, and I'll delete it later.

I did a diff between the .js's that I had and the new one. Notice a few changes:

Silverlight.createObjectEx({
    source: "Page.xaml",
    parentElement: document.getElementById("SilverlightControlHost"),
    id: "SilverlightControl",
    properties: {
        width: "100%",
        height: "100%",
        version: "1.1",
        enableHtmlAccess: "true"
    },
    events: {}
});

You don't refer to the Silverlight object via Sys.Silverlight any more. Also, enableHtmlAccess takes a string "true" when before a boolean worked for me. Also, the version has changed to "1.1".

Previous Silverlight project wizards or samples might have put this in your body's onload:

<body onload="document.getElementById('SilverlightControl').focus()">

Now, if you want your control to have initial focus, you need to add the onload in a friendlier way:

// Give the keyboard focus to the Silverlight control by default
    document.body.onload = function() {
      var silverlightControl = document.getElementById('SilverlightControl');
      if (silverlightControl)
      silverlightControl.focus();
    }
You'll also need to copy the new "minimized" Silverlight.js file and notice that its size has been nearly cut in half by the process. Shiny.


Tuesday, July 31, 2007 2:43:35 AM (Pacific Standard Time, UTC-08:00)
Looks like you've already started your new job. Congrats again Scott.
Tuesday, July 31, 2007 10:31:34 AM (Pacific Standard Time, UTC-08:00)
Thanks for this brilliant post. I've been trying to run my Silverlight project after updating to VS 2008 Beta 2 and with no luck. After I updated the project with you instructions everything started to work. Brilliant.. Thanks
Comments are closed.

Contact

Sponsors

Hosting By

Text Links

On this page...

Tags

Calendar

<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Archives

Google Ads