Enabling Out-of-Browser Support in Silverlight 3


Url: http://wilderminds.blob.core.windows.net/downloads/myoutofbrowser.zip

Silverlight Logo

One of the new features of Silverlight 3 that I wanted to play with first was the ability to create an Out-of-Browser experience. The Out-of-Browser feature remarkably different than Adobe AIR's approach. From the user's perspective, Out-of-Browser support in Silverlight 3 allows installation directly from the browser. For example, here's an application that I built to support Out-of-Browser:

outofbrowser_1

When you right-click the application, you get the opportunity to launch it out of the browser:

outofbrowser_2

Launching out of the browser supports actually installing desktop and start menu items as well:

outofbrowser_3

Once out of the browser, the title bar is shown appended with the source of the .xap file:

outofbrowser_4

To support this, you simply need to change your AppManifest.xaml file (located in your Properties folder in Silverlight) to include the Deployment.ApplicationIdentity section:

<Deployment 
  xmlns="http://schemas.microsoft.com/client/2007/deployment"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  
  <Deployment.Parts>
  </Deployment.Parts>

  <!-- Uncomment the markup and update 
       the fields below to make your 
       application offline enabled -->
  <Deployment.ApplicationIdentity>
    <ApplicationIdentity
        ShortName="Out of Browser Silverlight Application"
        Title="This app is out of the browser!">
      <ApplicationIdentity.Blurb>
        Sample Out of the Browser App
      </ApplicationIdentity.Blurb>
    </ApplicationIdentity>
  </Deployment.ApplicationIdentity>

</Deployment>

You can also launch the app out of the browser using the App.Current.Detach(). You can also test to see if the application is running offline:

if (!App.Current.RunningOffline)
{
    App.Current.Detach();
}

Adding Out of the browser support is that easy. What do you think?




Application Name WilderBlog Environment Name Production
Application Ver 1.1.0.0 Runtime Framework .NETCoreApp,Version=v1.1
App Path D:\home\site\wwwroot Runtime Version .NET Core 4.6.25009.03
Operating System Microsoft Windows 6.2.9200 Runtime Arch X86