(X) Hide this
    • Login
    • Join
      • Say No Bots Generate New Image
        By clicking 'Register' you accept the terms of use .

Silverlight as a Desktop Application (Out-of-Browser Applications)

(11 votes)
Nikolay Raychev
>
Nikolay Raychev
Joined Mar 28, 2008
Articles:   22
Comments:   58
More Articles
29 comments   /   posted on Mar 18, 2009
Categories:   Line-of-Business , Out-of-Browser

This article is compatible with the latest version of Silverlight.

Introduction

A cool new feature in Silverlight is the ability to run Silverlight applications out of the browser which resembles a desktop application. Only a few configuration steps are needed to enable your application to run offline.

See also:
Tip: Detecting Network Change in Silverllight 3 Application

Overview

To enable this feature you only need to open the AppManifest.xml file which can be found in the Properties folder and add
some settings as follows:

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  EntryPointAssembly="TaskList" 
  EntryPointType="TaskList.App">  
  <Deployment.Parts> 
  </Deployment.Parts> 
  <Deployment.OutOfBrowserSettings> 
    <OutOfBrowserSettings  
      ShortName="Task List">  
      <OutOfBrowserSettings.WindowSettings> 
        <WindowSettings Title="Offline Task List" /> 
      </OutOfBrowserSettings.WindowSettings> 
      <OutOfBrowserSettings.Blurb> 
        Allows saving your tasks offline  
      </OutOfBrowserSettings.Blurb> 
    </OutOfBrowserSettings> 
  </Deployment.OutOfBrowserSettings> 
</Deployment> 
 

Provided that your application is called TaskList you must add two attributes to the Deployment element:

  • EntryPointAssembly="TaskList"
  • EntryPointType="TaskList.App"

You must also add the OutOfBrowserSettings section with the following settings:

  • ShortName - the name of the application displayed on the desktop or the start menu.
  • Title - the title displayed in the title bar of the window which runs the application.
  • Blurb - this is seen in the "Comments" section of the file.

You are done. When you run your application in the browser you can notice the following context menu:



Note that if your application is not configured for offline use the "Install ... onto this computer..." is disabled and since we've configured it we can click it and the following dialog appears:



You have the option to choose where to put shortcuts to your application. By clicking "OK" you are ready and your Silverlight application is added as a standalone application.

Removing the application is as easy as adding it. When your application is saved for offline use the context menu looks as follows:



Clicking "Remove this application" and confirming removes the application from wherever it is added and also removes the shortcuts.

You also have the option to put your own icons which will be used by your application as a desktop icon, icon in the start menu, etc. You just need to create 4 png files with sizes 16x16, 32x32, 48x48 and 128x128. Include them in your project and set their Build Action to Content. It's easy, just right click on the image in the Solution Explorer and go to Properties. After that you must specify paths to the icons in the OutOfBrowserSettings section as follows:

<OutOfBrowserSettings.Icons> 
  <Icon Size="16,16">Images/sls16.png</Icon> 
  <Icon Size="32,32">Images/sls32.png</Icon> 
  <Icon Size="48,48">Images/sls64.png</Icon> 
  <Icon Size="128,128">Images/sls128.png</Icon> 
</OutOfBrowserSettings.Icons> 

That's all. You have your custom icons.

Now the whole AppManifest.xml file looks like:

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  EntryPointAssembly="TaskList" 
  EntryPointType="TaskList.App">  
  <Deployment.Parts> 
  </Deployment.Parts> 
  <Deployment.OutOfBrowserSettings> 
    <OutOfBrowserSettings  
      ShortName="Task List">  
      <OutOfBrowserSettings.WindowSettings> 
        <WindowSettings Title="Offline Task List" /> 
      </OutOfBrowserSettings.WindowSettings> 
      <OutOfBrowserSettings.Blurb> 
        Allows saving your tasks offline  
      </OutOfBrowserSettings.Blurb> 
      <OutOfBrowserSettings.Icons> 
        <Icon Size="16,16">Images/sls16.png</Icon> 
        <Icon Size="32,32">Images/sls32.png</Icon> 
        <Icon Size="48,48">Images/sls64.png</Icon> 
        <Icon Size="128,128">Images/sls128.png</Icon> 
      </OutOfBrowserSettings.Icons> 
    </OutOfBrowserSettings> 
  </Deployment.OutOfBrowserSettings> 
</Deployment> 

The application updates automatically whenever you release a new version on the server. When you start the offline version or it detects that the network is present it checks for a new version, downloads it and updates itself. Whenever you start it again you will be using the updated version.

Demo

As an example I created the following demo:


This is a simple tasks list. You can add or delete tasks. The tasks are saved on the server and the application is using WCF Service to connect to the server. Nothing special. But if you save the application for offline use you can use it even if you don't have internet connection. I'm using the isolated storage to keep copy of the data on the client and the application is working with the local copy when there is no connection. It synchronizes automatically whenever the connection comes back.

Download Source 

Conclusion

This article describes the steps you need to make in order to allow the users to make your Silverlight application act like a Desktop application on their computers. Any comments are welcome.


Subscribe

Comments

  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Zeze Lazo (zezelazo@msn.com) on Mar 19, 2009 07:24
    I cant install the app, the menu item is disabled, i need something more, i have the beta 3 developer runtime
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Zeze Lazo (zezelazo@msn.com) on Mar 19, 2009 07:28
    I solveit :p the menu item is enables only at the first page (with button [Show Task]), in the next page the link is disabled
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Hunsoul on Jul 13, 2009 16:29
    The download link is dead...could you check it please?
  • nikolayraychev

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by nikolayraychev on Jul 15, 2009 11:19
    Hunsoul, the source is available now and is converted to Silverlight 3 RTW.
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by vijay on Aug 18, 2009 15:45
    cool :-) really nice, simple & useful article.

    Vijay


  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Alexo on Sep 23, 2009 22:53
    Thx man, is very usefull !!!!!! like it
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Dave on Sep 25, 2009 15:09
    Excellent, thanks for this
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by okyanus on Sep 28, 2009 13:20
    super
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Thomas on Oct 30, 2009 12:28
    The VS tool for SL 3 now have an option to create the OOB settings for you.  Double click the project file  Select Enable running application out of browser and then hit the Out of Browser Settings button and youre done.
  • nikolayraychev

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by nikolayraychev on Nov 10, 2009 15:19
    Thanks for the useful info, Thomas.
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by UYGUR on Nov 24, 2009 14:43
    Thanks!
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Marco on Feb 19, 2010 12:54
    Very useful, cheers !!
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Christine on Mar 03, 2010 18:39

    Great!

    Thanks a lot :)

  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Roger on Mar 18, 2010 12:56
    Thumbs Up!
  • -_-

    RE: Silverlight 3 as a Desktop Application (Out-of-Browser Applications)


    posted by Gaurav bhardwaj on Jun 11, 2010 07:13
    Can be pass the WCF data on the  out of browser applications when this connection will be established with the server and how Out Of Browser application will come to know that  this is the connection that it has to be established with WCF client
    .
  • -_-

    RE: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by Harish on Apr 29, 2011 09:50
    Nice !!
  • AmanChawla

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by AmanChawla on May 21, 2012 11:03

    Viewing as a desktop application

    It can be done in this way...

    http://amtdw.blogspot.in/2012/05/techie.html

    But what's the difference???

     

  • interlacecondo1

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by interlacecondo1 on Mar 28, 2014 07:38
    Several buses are available near The Interlace along with shopping centers and restaurants. The Interlace is also near Mount Faber Park, the shopping, dining and entertainment hub. The Interlace top
  • laxman143

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by laxman143 on Apr 01, 2014 06:37

    Hello , I m in trouble.. when  i run Silverlight Application  out of browser  that time must be open silverlight application in visual studio , but i dont want to this type..i want only when click on the shortcut then open the application....how can i do this.....plz Help me as soon as Possible ....



    Thanks.

  • laxman143

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by laxman143 on Apr 01, 2014 07:45

    Hello , I m in trouble.. when  i run Silverlight Application  out of browser  that time must be open silverlight application in visual studio , but i dont want to this type..i want only when click on the shortcut then open the application....how can i do this.....plz Help me as soon as Possible ....



    Thanks.

  • laxman143

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by laxman143 on Apr 01, 2014 07:53

    Hello , I m in trouble.. when  i run Silverlight Application  out of browser  that time must be open silverlight application in visual studio , but i dont want to this type..i want only when click on the shortcut then open the application....how can i do this.....plz Help me as soon as Possible ....



    Thanks.

  • laxman143

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by laxman143 on Apr 01, 2014 07:56

    Hello , I m in trouble.. when  i run Silverlight Application  out of browser  that time must be open silverlight application in visual studio , but i dont want to this type..i want only when click on the shortcut then open the application....how can i do this.....plz Help me as soon as Possible ....



    Thanks.

  • ctowers1

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by ctowers1 on Apr 03, 2014 06:26
    Entertainment for your loved ones and friends is therefore at your fingertips with the full condo facilities as well as the amenities near Commonwealth Towers. commonwealth towers 4 bedroom
  • jenis56

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by jenis56 on Apr 03, 2014 13:10

    Most of the time I don't make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post..

    GP jobs
     

  • jenis56

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by jenis56 on Apr 05, 2014 10:52

    Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles.

    Sales hiring and development assessment tools
     

  • fortezzacortesi

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by fortezzacortesi on Apr 05, 2014 12:43

    historic country resort between Siena and Florence

     

    I hope you this is really very famous for providing the different info in this blog that to utilize the nice approach is visible in this blog ,Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of  your posts 

  • fortezzacortesi

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by fortezzacortesi on Apr 05, 2014 12:44
    Romantic exclusive B&B in Tuscany
    Thanks for sharing excellent informations. Your web-site is very cool. I'm impressed by the details that you have on this web site. check out Blue host review.Information very useful! I've been looking for books of this nature for a way too long. I'm just glad that I found yours.

     

     

  • realestate1

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by realestate1 on Apr 10, 2014 04:28
    Commenting, a spokesperson from ERA said: “We believe that this will be a very informative session for the public and for those who would like to learn more about the current HDB market, especially given the new policies and rulings in the property sector.” interest in australia
  • jenis56

    Re: Silverlight as a Desktop Application (Out-of-Browser Applications)


    posted by jenis56 on Apr 11, 2014 10:45

    Narrowtex is a principal manufacturer of a wide range of quality industrial webbing in various colours, widths, textures, materials and intricate designs.

     

     

Add Comment

Login to comment:
  *      *