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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

364<br />

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

The id Property<br />

This is the required ID for the <strong>Silverlight</strong> control. If you want to reference the control<br />

from JavaScript in order to manipulate it or its DOM, it needs to be identifiable, <strong>and</strong> as<br />

such, the control needs an ID.<br />

The width Property<br />

This sets the width of the control in percent or pixels. This will be limited by the size of<br />

the containing the control.<br />

The height Property<br />

This sets the height of the control in percent or pixels. This will be limited by the size of<br />

the containing the control.<br />

The background Property<br />

This sets the background color for the control. This uses a XAML SolidColorBrush control<br />

to determine the color, which can be a named color (e.g., Blue) or an ARGB value for 8<br />

bits each of alpha, red, green, <strong>and</strong> blue (e.g., #00FF00BB).<br />

The framerate Property<br />

This sets the maximum frame rate to allow for animation. It defaults to 24 frames per second.<br />

This is particularly useful for applications that use a lot of animation. Should you<br />

want to smooth out the animation, you can adjust the frame rate for the optimal effect.<br />

The isWindowless Property<br />

By default, the <strong>Silverlight</strong> plug-in runs inline in the page, meaning that HTML content<br />

flows around the plug-in. In many scenarios, you may want to write HTML content on<br />

top of the <strong>Silverlight</strong> content, perhaps to have an HTML form on top of your page, or to<br />

render a GIF or other graphics from a server that you don’t want to inject into your XAML.<br />

This is possible using the isWindowless property. When set to true, HTML content can<br />

be written on top of the <strong>Silverlight</strong> content. The default is false.<br />

For example, here is the create<strong>Silverlight</strong> function amended to show isWindowless<br />

being set:<br />

function create<strong>Silverlight</strong>()<br />

{<br />

<strong>Silverlight</strong>.createObjectEx({

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

Saved successfully!

Ooh no, something went wrong!