Prism-v2 Reference Implementation migrated to Silverlight 3 with Out-Of-Browser Capabilities

Today I finally decided to blog about the Prism-v2 Silverlight reference implementation using Silverlight 3 Beta.

In this post I will explain the process and some of the modifications I made to the application to use some of Silverlight’s new features and provide the outcoming source code.

So after opening the RI with SL 3 installed the well known migration wizard appeared.

convertsolution

The migration was a pretty straightforward process, and after less than a minute it finally succeeded and was ready for use.

Note: The steps above enable the Reference Implementation to run with Silverlight 3 correctly. From now on I will just add some functionality new in Silverlight 3.

So with Julian, Ezequiel and Matias we started to think which of the new features from Silverlight 3 could be shown working in the Reference Implementation.

After a small talk, our choice was out-of-browser (OOB) functionality.

Implementing Out-Of-Browser (OOB) functionality

For those who have not yet had the chance to read about this Silverlight 3 feature I will provide some links at the end of this article.

To enable OOB, I opened the AppManifest.xml file, and changed its content to the following:

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Deployment.Parts>
  </Deployment.Parts>
  <Deployment.ApplicationIdentity>
    <ApplicationIdentity
        ShortName="Prism-v2 RI Silverlight 3"
        Title="Prism-v2 Reference Implementation working out of the Browser with Silverlight 3">
      <ApplicationIdentity.Blurb>
        Prism-v2 RI running out of browser in Silverlight 3
      </ApplicationIdentity.Blurb>
    </ApplicationIdentity>
  </Deployment.ApplicationIdentity>
</Deployment>

Having done that, OOB should have been enabled. I ran the application and right clicked to check if this worked correctly. After confirming that I wanted to install the application, the following message was shown:

install

Ok, the objective was complete. However, that picture is not the one that represents our application the best.I created some images, added them to a folder in the StockTraderRI project (Icons folder). After setting the build action of each image to “Content” and I updated the code in the AppManifest.xml so the icons would be used in the OOB application:

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Deployment.Parts>
  </Deployment.Parts>
  <Deployment.ApplicationIdentity>
    <ApplicationIdentity
        ShortName="Prism-v2 RI Silverlight 3"
        Title="Prism-v2 Reference Implementation working out of the Browser with Silverlight 3">
      <ApplicationIdentity.Blurb>
        Prism-v2 RI running out of browser in Silverlight 3
      </ApplicationIdentity.Blurb>
      <ApplicationIdentity.Icons>
        <Icon Size="16x16">Icons/icon16.png</Icon>
        <Icon Size="32x32">Icons/icon32.png</Icon>
        <Icon Size="48x48">Icons/icon64.png</Icon>
        <Icon Size="128x128">Icons/icon128.png</Icon>
      </ApplicationIdentity.Icons>
    </ApplicationIdentity>
  </Deployment.ApplicationIdentity>
</Deployment>

After that, the picture changed to show one of the pictures chosen:

install2

After checking both options (there is no need to check any of the options, I just did), the application was launched out of the browser :)

oob

Source Code

Disclaimer

This code is provided “AS IS” with no warranties, and confers no rights.

Download

You can get source code here: Prism-v2 RI with OOB capabilities.zip.

UPDATE 2009-07-13: I updated the application for the official Silverlight 3 release. You can check it out here.

Final thoughts

For more information about out-of-browser experience you can check:

Some other posts related to Silverlight 3 and Prism-v2:

I hope this post is useful to you, and your feedback, opinions and thoughts are always welcome to continue improving.