Saturday, February 19, 2011

Running Silverlight Out-of-Browser (OOB)


A new capability of Silverlight 3 is running out-of-browser, meaning that users can load
your application onto their desktop without needing to visit the hosting site. To implement
OOB, open the Silverlight application properties by double-clicking the Properties folder
in Solution Explorer. You'll see a window similar to Figure 1.
Most of the properties in Figure 1 have been covered in previous chapters. What's
different is the section on Silverlight build options, which allows you to set the version
and check the box to reduce the size of the *.xap file through caching. However, leave the
option to reduce the *.xap file size unchecked if running OOB because it's not compatible
Figure 1 Silverlight properties


Figure 2 Out-of-browser settings
with OOB. The Manifest file describes the contents of the *.xap file. To enable OOB,
check the box "Enable running application out of the browser." Then click the Out-Of-
Browser Settings button to display the window shown in Figure 2.
The OOB settings in Figure 2 allow you to set information for the application,
the size it will take when running, and variously sized icons that Windows will display.
Setting GPU acceleration allows the application to take advantage of the local hardware to
optimize graphics.
After you save OOB settings and run the application, the user can right-click the
application running in the browser and select Install SilverlightDemoCSApplication Onto
This Computer, as shown in Figure 3.
Figure 3 Choosing OOB
The next window you'll see gives options for adding the application to the Start menu
and an icon on the desktop. Figure 3 shows that both options are checked.
When you click OK, Silverlight creates a Start menu item and adds the application
to the desktop, as shown in Figure 4. When you start the application, it will run in a
window rather than the browser.


Figure 4 Executing an OOB application

No comments :

Post a Comment