Window Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 6 April 2009

Silverlight 3 : Out of Browser Support – Part 6

Posted on 01:21 by Unknown

Some people saying on various blogs and forums that this was the most awaited feature of Silverlight, well I have not contributed there because few questions came to my mind :

  • Why we need such thing when we have capability of creating WPF applications which will run on desktop/out of browser environment ??
  • How they will run? will they need Silverlight Plug-in or will they run as standard exe under windows environment? (Sorry, I said windows environment,because I don’t have Mac and Linux environment with me for testing)
  • If we process some data in Silverlight Out of Browser, will it get store in Isolated Storage? will it be sufficient storage since there is lot craze going on for Silverlight LOB applications.

Well, I started exploring at my best, Some of above are still unanswered questions for me,but I really find Out-of-Browser as an Innovation in Silverlight Technology. Since we are doing a lap around series, right now I will discuss only how to make it out of browser, once I finish this initial series, I will then take each topic in depth.

Requirements for Out of Browser Silverlight Applications :

  • Working Silverlight application.
  • sllauncher.exe file should be available.

Once your Silverlight application is ready, then to make it available out of browser, first you need to go to file “AppManifest.xml” under Properties folder.Then you will find a commented block with following message :

<!-- Uncomment the markup and update the fields below to make your application offline enabled –>

You just need to uncomment it and you are then done with it. Basically it contains :

<Deployment.ApplicationIdentity>
        <ApplicationIdentity
            ShortName="Out of Browser Silverlight Application"
            Title="My Out of Browser Silverlight Application-MVP Vikram Pendse">
            <ApplicationIdentity.Blurb>Out Of Browser Silverlight Application Created by MVP Vikram Pendse</ApplicationIdentity.Blurb>               </ApplicationIdentity>
</Deployment.ApplicationIdentity>

If you observe carefully, there is nothing “great” to understand that piece of xaml, it is pretty self-explanatory. Title attribute will show the Title on your out of browser app and <ApplicationIdentity.Blurb> will hold the description about application. So any more thing can be done with this block?..yes, a lot more can be done. You can customize the experience by adding your own icons to app,but before this, first lets talk how to launch this application out of browser. First run your application in browser, then right click on your application, you will get following context menu :

outb1

 

outb2

In era of Silverlight 2, we use to get only one option in context menu as “Silverlight Configuration” , now with the introduction of Silverlight 3 Out of browser support, we get second option as “Install..<followed by name of application>..onto this computer…”, once you click on this, you will get following message window :

outb3

Well, We have two options now, Start Menu and Desktop but have you read this message above it? as “Please confirm the locations for the shortcuts.” ,see the last word “shortcuts”, so it creates shortcuts for what and whom? Answer is :

C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe

No, I am not saying with no base to you, if you check on Desktop a shortcut will be generated, you double click it, it will run your application as is it runs in browser, if you choose Start Menu, it will add link in Start list and both can be check too.

Well if you right click on that shortcut generated, you will get :

outb4

If you see the Target box it contains :

"C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe" localhost.0

Comment box shows : “Allows saving your tasks offline”

[Try to change Target as “c:\” and see the effect and change in icon, Also try to delete sllauncher.exe or put it at different locations and check then if that out of browser working or not, Also try to run it on Non Silverlight environment,Try to open that offline application in Reflector etc.This will help you more to understand the architecture of this.]

Now see this install application window again :

outb3

If you see this box, you can see a Icon on left side, to customize this experience and to put your own Icon, you need to add following xaml in that uncommented block in AppManifest.xaml like this :

<ApplicationIdentity.Icons>
        <Icon Size="16x16">Images/sls16.png</Icon>
        <Icon Size="32x32">Images/sls32.png</Icon>
        <Icon Size="64x64">Images/sls64.png</Icon>
        <Icon Size="128x128">Images/sls128.png</Icon>
</ApplicationIdentity.Icons>

You can set some images to this screen of install application as well as in your title bar of actual offline application. it can be in different sizes like “16X16”,”32X32”..etc. with embedding path of that image.

So question may to come to your mind that “Can it be done programatically??” ..means can you detach this browser app to out of browser programatically?, answer is “Yes, you can!”.

If you have command button in your browser application, then you can use its click event to detach app like this :

private void Button_Click(object sender, RoutedEventArgs e)       {
          App.Current.Detach();
}

Basically App.Current.Detach(); returns a boolean, so you can check the state whether it is detached or not.

Also with App.Current.RunningOffline you can check whether application is running in browser or out of browser,since it is also returns you boolean.

If you want to remove this application, you can do so by again right clicking on application,like this :

outb5

outb6 

Well, let me make it clear that right now it is not supporting Microsoft Sync Framework, In my upcoming articles I will be talking about handling data and giving calls to services etc. so this out of browser concept will be more clear to you. I know few more things can be talked on this, but I am not doing here since we are in our lap around introductory phase and also we need to learn other features too, so do expect more stuff here in coming days.

Hope this will help you to understand Silverlight Out of Browser.

Vikram.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • First Windows Phone 7 update February 2011 - Small update but Big start
    After tons of rumors and set of predictions on Windows Phone 7 all over Internet, Microsoft came up with first Windows Phone 7 minor update ...
  • The little Story of “I Unlock Joy” event by Microsoft and Pune User Group
      This post is about recent “I Unlock Joy” event happened in Pune which was conducted by Microsoft and Pune User Group. Little History : ...
  • Silverlight On Mobile : Windows Phone 7 Splash Screen and Customization
    After talking about 3D capabilities on Windows Phone 7 using Silverlight in last article , Now I am moving ahead with small but equally impo...
  • Silverlight 5 : Platform Invoke (PInvoke) in Silverlight
      Two days back Microsoft announced availability of Silverlight 5 RC,I encourage you to download bits from here , My friend Pete Brown alr...
  • Introduction to Speech Capabilities in Windows Phone 8 – Part 1
    After a long..I am writing blog, I hope and I wish I will resume blogging like I use to in past. Lots of things happened in past few months....
  • MCTS : Microsoft Silverlight 4 Development Exam Guide (70-506) by Packt Publishing
      Hello, After a long time I got chance to come back here.I will soon resume blogging in month of August. Last 4-5 months were horrible due...
  • Introduction to Speech Capabilities in Windows Phone 8 – Part 2
    Hope you enjoyed my last article on Speech Capability in Windows Phone 8, Today I am posting another part or you can say little extension t...
  • Silverlight 3 : Insert & Update Data using WCF Service with DataForm and DataGrid
    In my Lap around Silverlight 3 series, I have written a separate article on DataForm in Silverlight 3, This article is a basic extension to ...
  • Mango : Using DeviceStatus in Windows Phone 7.1
    First of all “Thank You” for your wonderful response and comments on my last article on Silverlight Vs HTML5 ,I hope you like the points I ...
  • Silverlight, HTML5 & Windows 8 : Where we are heading to ?
    This is not the post or yet another post on most happening debate of Silverlight and HTML5, This is just a visit to all of them to realize t...

Blog Archive

  • ►  2013 (4)
    • ►  August (1)
    • ►  April (3)
  • ►  2012 (4)
    • ►  July (1)
    • ►  March (2)
    • ►  January (1)
  • ►  2011 (24)
    • ►  December (1)
    • ►  September (4)
    • ►  August (2)
    • ►  July (1)
    • ►  June (4)
    • ►  May (3)
    • ►  April (3)
    • ►  March (1)
    • ►  February (4)
    • ►  January (1)
  • ►  2010 (21)
    • ►  December (1)
    • ►  November (2)
    • ►  October (3)
    • ►  September (2)
    • ►  August (4)
    • ►  July (5)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  January (1)
  • ▼  2009 (49)
    • ►  December (1)
    • ►  November (5)
    • ►  October (2)
    • ►  September (1)
    • ►  August (5)
    • ►  July (5)
    • ►  June (1)
    • ►  May (5)
    • ▼  April (5)
      • DataBinding in Blend 3 for Designers
      • Overview of Live Smooth Streaming,Live Encoding an...
      • Silverlight 3 : DataGrid Programming – Part 7
      • Silverlight 3 : Out of Browser Support – Part 6
      • Silverlight 3 : Creating Ads using Silverlight Adv...
    • ►  March (9)
    • ►  February (4)
    • ►  January (6)
  • ►  2008 (43)
    • ►  December (3)
    • ►  November (9)
    • ►  October (7)
    • ►  September (4)
    • ►  August (2)
    • ►  July (3)
    • ►  June (4)
    • ►  May (3)
    • ►  March (3)
    • ►  February (5)
Powered by Blogger.

About Me

Unknown
View my complete profile