I am planning to write some posts on new features in Silverlight 3.0.
I decided to start with the easiest one – out of browser support. Start by creating new Silverlight application in Visual Studio. Once it is created, go to properties of the Silverlight application project. You will see this window:
Check “Enable running application out of browser”, then click on Out-of-Browser Settings button. You will see this screen.
Once you fill in all the settings, you are ready to go. All settings from this screen are stored in XML file called OutOfBrowserSettings.xml. The actual fact that a particular application is enabled for out-of-browser support is stored in .csproj file.
Once you run the application, if you right-click on the application, you will see context menu with additional option – install on desktop. If application is already installed, the option changes to remove application.
The installed application can be now run from the computer from the shortcut. When you run the app from the shortcut, it is not going run in the browser, instead it is run in sllauncher.exe, a special program designed to host Silverlight application. At that point, you do not have access to browser based functionality. So, before you reach to HtmlPage.Window, check to see if application is running in browser. You can do this by checking App.Current.IsRunningOutOfBrowser property.