08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

366<br />

CHAPTER 15 ■ ENHANCING THE WEB EXPERIENCE WITH SILVERLIGHT<br />

medallion to install <strong>Silverlight</strong>, they will be directed to the <strong>Silverlight</strong> install page hosted<br />

on the Microsoft web site. This will allow them to read the license agreement for using<br />

<strong>Silverlight</strong>, <strong>and</strong> download <strong>and</strong> install the control. Once done, they can return to the original<br />

page <strong>and</strong> view the <strong>Silverlight</strong> content.<br />

When this property is set to true, a slightly different <strong>Silverlight</strong> medallion is presented.<br />

This medallion contains links to the license agreement, <strong>and</strong> clicking it implies<br />

acceptance. In this situation, the user isn’t taken away from the site; instead, the download<br />

of the <strong>Silverlight</strong> plug-in will start automatically, <strong>and</strong> the user can install it in place.<br />

Once done, they can access the <strong>Silverlight</strong> application straightaway.<br />

The FullScreen Property<br />

<strong>Silverlight</strong> can run in full screen mode, where <strong>Silverlight</strong> content is drawn on top of all<br />

other windows. This is typically used for video playback, where the user wants to fill their<br />

monitor with the desired video. To do this, simply set the FullScreen property of the control<br />

to true. To change it back, set it to false.<br />

The actualWidth Property<br />

When the width property is set to a percentage value, the width of the <strong>Silverlight</strong> control<br />

changes based on the user’s interaction with the browser. As a result, the value of the<br />

actual width of the control can be read using the actualWidth property. In addition, if this<br />

value changes, the onResize event will fire.<br />

The actualHeight Property<br />

When the height property is set to a percentage value, the height of the <strong>Silverlight</strong> control<br />

may change based on the user’s interaction with the browser. As a result, the value of the<br />

actual height of the control can be read using the actualHeight property. In addition, if<br />

this value changes, the onResize event will fire.<br />

The initParams Property<br />

This is a string that you can use to set additional parameters on the control. These are<br />

completely free format, so you can do whatever you like with them. A typical scenario for<br />

this would be where you generate the <strong>Silverlight</strong> content from a server-side control, <strong>and</strong><br />

you want to maintain the state of the parameters for it on the client side.<br />

Here’s an example of a create<strong>Silverlight</strong> function with the parameters set simply as<br />

value1, value2, value3. In this case, you would write code to read these parameters <strong>and</strong><br />

respond to them as you see fit.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!