15.02.2015 Views

C# 4 and .NET 4

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

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

navigation ❘ 1097<br />

➤<br />

Media — This is an important aspect of web applications that has special support in Silverlight. With<br />

streaming, you can use features such as progressive downloading <strong>and</strong> smooth streaming, <strong>and</strong> add<br />

timeline markers to streams. With the DeepZoom technology <strong>and</strong> the MultiScaleImage control,<br />

you can create an impressive user experience, allowing users to zoom into large images that are built<br />

up from several image files. To create DeepZoom images, you use the DeepZoom composer, which<br />

creates the Silverlight code to use the MultiScaleImage control.<br />

CreaTing a silVerlighT ProjeCT<br />

When creating a new Silverlight project with Visual<br />

Studio, you’re asked if a Web project should be<br />

created as well (see Figure 38-1). The Web project<br />

contains test pages to test the Silverlight application<br />

<strong>and</strong> contains the binary files from the Silverlight<br />

project. With the Web project type, you can choose<br />

between an ASP.<strong>NET</strong> Web Application Project <strong>and</strong><br />

an ASP.<strong>NET</strong> MVC Web Project. ASP.<strong>NET</strong> MVC is<br />

shown in Chapter 42.<br />

The project that is created for this chapter is<br />

SilverlightDemos, with the Web project<br />

SilverlightDemos.Web. In the Visual Studio<br />

2010 Web Project project settings is a tab labeled<br />

SilverlightApplications, which contains references to<br />

the Silverlight project in the solution <strong>and</strong> the path<br />

to the location that the binaries of the Silverlight<br />

project (the XAP file) should be copied to, usually the<br />

directory ClientBin.<br />

The HTML test page contains an object tag that references the<br />

binary of a Silverlight control with the source parameter. The parameter<br />

minRuntimeVersion defines what version of the Silverlight runtime is<br />

needed on the client system. If the client system doesn’t have the Silverlight<br />

runtime installed, a hyperlink is specified with a default image from a<br />

Microsoft site, as shown in Figure 38-2, to inform the user about the<br />

Microsoft Silverlight installation. When this test page starts, the Silverlight<br />

control is loaded in the web browser.<br />

naVigaTion<br />

figure 38-1<br />

figure 38-2<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

code snippet SilverlightDemos.Web/SilverlightDemosTestPage.html<br />

One difference between Silverlight <strong>and</strong> WPF projects is how navigation between pages is h<strong>and</strong>led. Of course,<br />

in web applications, navigation between pages is a common task.<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!