Chapter 1. Three Years of Silverlight

IN THIS CHAPTER, WE WILL:

• Discuss what happened since Silverlight 2 Unleashed came out.

• Talk about cross-browser and cross-platform compatibility for Silverlight 4.

• Consider alternatives to Silverlight, both in the browser and out-of-the-browser.

• Look at the earlier versions of Silverlight 1.0, 2 and 3 and take a look into the future of this technology.

• Install Silverlight 4 as a user and explore a few demos.

In three short years, Silverlight has come a very long way. In this chapter, we review what Silverlight is, where it comes from, and try to peek into the future of this technology, illustrated by the “shiny logo” shown in Figure 1.1.

Figure 1.1 Silverlight logo.

image

Discovering Silverlight 4

It seems like yesterday that we published Silverlight 2 Unleashed and introduced it at the Professional Developer Conference 2008 in Los Angeles just a few days after Silverlight 2 had been released to the Web. And yet here we are talking about Silverlight 4 already! In these less than two years, the Silverlight team at Microsoft has been very active listening to the community’s feedback and implementing new features to transform what was an already solid, yet basic platform into a very rich framework, able to accommodate most client application developers’ needs.

The very first public glimpse of Silverlight 4 beta was offered at the Professional Developer Conference 2009, when Scott Guthrie (Corporate Vice President, .NET Developer Platform, Microsoft) gave one of the exciting talks full of demos for which he is famous. Although still in beta stage, we were already able to clearly see the direction that the technology was taking. Even more important, we were told often that Silverlight is the future of client applications at Microsoft!

With this new release, the border between web applications and desktop applications is becoming much thinner. For example, Silverlight 4 can now install applications “out of the browser,” with a shortcut in the Start menu or on the desktop. Although these applications have fewer privileges and features than full-blown desktop applications, they have the huge advantage to be cross-platform (you can run them on Apple computers, too) and provide a very elegant way to offer rich functionality in online and also offline mode. We talk a lot more about out-of-the-browser applications in this book.

Tip

What About Windows Presentation Foundation?

The richer (but running on Windows only) “big sister” of Silverlight called Windows Presentation Foundation (WPF) is still actively developed and extended by Microsoft, although in a maybe less-glamorous way. See the section “Alternatives to Silverlight,” later in this chapter.

A lot of other features, which we discuss later too, help the developers to build so-called line-of-business (LOB) applications (for example, rich data applications for businesses, catalogs for products, data visualization screens, and many more). Silverlight is often mistaken for yet another media framework, when it is in fact much more than this. This new release makes the point very clear, and should help to put Silverlight in the focus of enterprise applications developers while continuing to build on the success it already has for multimedia applications.

Learning Silverlight Is Betting on the Future

With all this in mind, it is quite clear that learning Silverlight is a perfect way to advance in the future of client application development:

• For web developers, it adds important skills to your arsenal that will help enrich your web pages. Silverlight is not replacing classic web technologies such as Hypertext Markup Language (HTML), Cascading Style Sheets (CSS), and JavaScript, but it enhances them and plays an important role in the way that websites are evolving always more from document presentation to rich interactive applications.

• For “classic” desktop developers in the Windows world (with technologies such as Microsoft Foundation Classes [MFC] or Windows Forms), it teaches you a modern and exciting framework with revolutionary features such as the fantastic data binding system, rich animations and graphics, media integration, and so on.

• For WPF developers, you leverage a lot from what you already know and gain cross-platform compatibility for your applications, easy web deployment, and exposure to a wider audience.

One important thing to keep in mind is that Silverlight is not a replacement for HTML web pages, and will absolutely not kill HTML. Silverlight is here to enhance your web pages with richer content, and with the out-of-the-browser feature, to create lightweight applications that can function online or offline. Learning Silverlight does not mean that you should avoid writing HTML code, or that you should stop investing in technologies such as ASP.NET. But it means that you can now realize applications that were impossible (or very difficult) to do in HTML/CSS/JavaScript, and that you can use the same languages (and in some cases reuse code) on the server and on the client.

How Can They Be So Fast?

There are a few aspects that explain how new versions of Silverlight can hit the market so fast, and yet be so stable:

• Silverlight is developed in an agile manner. With short iterations and early releases, the team is able to react quickly when problems are found in the code or new features are suggested. This explains why we had three releases in less than three years.

• Silverlight is taking advantage of the experience gathered by the Windows Presentation Foundation team. Many features are similar, and some code can even be reused. Other features are re-implemented in a different way based on customer feedback. The teams are communicating to leverage the experience gained since WPF was released.

• The community is involved in an interactive manner. Your input counts! We will talk about ways to get involved in this chapter.

Tip

The Community Counts!

Did you know that approximately 70% of the features requested by the Silverlight community have been implemented in Silverlight 4!

How About Compatibility with Older Versions?

An agile team at work for Silverlight provides a great basis for a rich feature set evolving very fast. With version 4, we can say that Silverlight is reaching maturity. There will, of course, be additional versions in the future, but it is obvious that versions 3 and 4 were major steps for this platform, which explains Microsoft’s enthusiasm at the conferences where early versions were shown. Note, however, that a lot of effort has been put into backward compatibility:

• If you open a Silverlight 2 (or 3) project in the Silverlight 4 development environment, a lot of your code will work as is. Some of it will need to be updated, but the changes are, in general, painless ones. Note that the project files (*.CSPROJ) will be updated to the new environment, though.

• If you run a Silverlight 2 (or 3) application on a PC with Silverlight 4 installed, it will run without glitches, because the runtime environment is fully backward compatible.

In fact, your Silverlight 2 (or 3) applications should run even better in a Silverlight 4 runtime environment, because of the improvements brought to the core and to the plug-in. This history of backward compatibility is most certainly going to continue with future versions, so what you learn now is going to be a major skill for your future as a developer.

Cross-Browser and Cross-Platform Compatibility

The version of Silverlight developed by Microsoft is available on a wide variety of platforms, both on the Windows and Macintosh operating systems. This plug-in will run on all these platforms with the same feature set (with one exception that we will discuss in Chapter 18, “Drag and Drop, Full Screen, Clipboard, COM Interop, Duplex Polling, Notification Windows, and Splash Screens,” namely the COM integration that is of course available only on Windows operating systems).

In addition, Novell is working on a version named Moonlight, available for certain distributions of Linux. The effort by Novell is encouraged by Microsoft but is conducted independently. This is why the version releases are not necessarily coordinated, and there might be some discrepancies in the feature set, too. However, a great effort is being expended to create a plug-in that is largely compatible with the one developed by Microsoft.

Finally, we will also take a look in Chapter 15, “Developing Navigation Applications and Silverlight for Windows Phone 7” at Silverlight for the mobile platform. After announcing that they wanted to support the mobile platform, Microsoft did not communicate much and encountered a few technical difficulties that took longer than expected to solve. This year, however, we finally heard much more about support for the mobile platform, and we will take a first look at what will be available in the near future.

In short, Silverlight is your best bet if you want to run .NET-based code on a large number of platforms!

Windows and Macintosh

The following table shows in detail what is and is not possible with the plug-in implemented by Microsoft.

Tip

Things Are Moving Fast

Table 1.1 is a snapshot at the time of this writing. The situation keeps changing, with new browsers and platforms being added. To get the latest information, make sure to visit the Silverlight.net website!

Table 1.1 Cross-Platform and -Browser Compatibility

image

1 Windows 2000 requires the installation of an update (KB 891861) to execute Silverlight applications.

Note the following restrictions:

• The Opera web browser is not officially supported at the time of this writing.

• PowerPC-based Apple computers support only Silverlight 1.0.

Linux

For Linux, FreeBSD, and Solaris operating systems, things are changing fast, so the best thing to do is to check the information on the Novell Moonlight website at http://www.galasoft.ch/sl4-moonlight.

Alternatives to Silverlight

Because Silverlight 4 can run inside or outside of the web browser, its alternatives cover a wider landscape. Interestingly, though, not many technologies allow you to program just once but run on multiple platforms and in multiple modes (offline/online, in the browser/out of the browser). In that sense, Silverlight is pretty unique.

In the Web Browser

Silverlight is traditionally a connected application running within a web browser. In that field, the landscape didn’t really change much since Silverlight 2, with the exception maybe of XHTML, which is barely mentioned anymore and considered already obsolete now that HTML5 is becoming a trending topic.

Adobe Flash

This is the obvious contender, the one technology that is most often mentioned when Silverlight is compared to other frameworks. Adobe Flash is installed on a huge number of computers and various operating systems. It is also a well-known environment, and many companies develop applications in Flash for the Web.

As mentioned when Silverlight 2 was released, Flash is not going to be killed by Silverlight, and in fact this was never Microsoft’s intention. Rather, Silverlight provides a welcomed alternative to firms who do not want to invest in two very different technologies for the desktop and the Web. In that sense, Silverlight is a great choice because it is developed with the same languages and the same tools as the well-known Windows Forms, ASP.NET, and WPF.

Silverlight and Flash are coexisting on the Web, sometimes even in the same web pages. Thankfully, this is easy to realize, and there is even a possibility to let these mixed applications communicate together through JavaScript. This allows a gradual modification of existing websites from Flash to Silverlight, without breaking the functionalities or forcing the users to adapt to large-scale changes. We actually saw some striking examples of this at Microsoft itself, with existing Flash applications being gradually converted to Silverlight without disruptions.

DHTML and AJAX

DHTML (Dynamic HTML) and AJAX (Asynchronous JavaScript and XML) are often used together on web pages to create a more interactive experience. This was made popular with web developers by the release of JavaScript frameworks such as jQuery.

The advantage of these frameworks is that they standardize the JavaScript functions by providing a layer on top of the various implementations available in different web browsers on different platforms. jQuery can be extended by plug-ins that are available for the user experience itself (for example, to create smoother animations), or at a lower level to enhance the communication with the web server, and so on. Also, they do not require an additional component in the web browser to run.

Tip

Using jQuery in ASP.NET

Did you know that Microsoft supports jQuery development by contributing to this open source project, and including it in ASP.NET MVC (Model, View, Controller) projects in Visual Studio.

However, programming in JavaScript is not an easy task. The dynamic nature of the language makes it more difficult to offer advanced development tools (such as IntelliSense in Visual Studio) and to find and correct bugs. Also, the HTML platform is limited: Advanced and smooth animations with high frame rates are impossible to realize, it is impossible to create certain transformations for graphic elements, and so forth.

Note, however, that using Silverlight on a web page doesn’t prevent you from using jQuery or another JavaScript-based framework—on the contrary. Here, too, these technologies complement each other.

HTML5

This new revision of HTML intends to provide a wide range of rich functionality, allowing developers to reduce the use of third-party plug-ins. In this matter, it positions itself as a concurrent of Adobe Flash and Microsoft Silverlight.

Although it is true that plug-ins cause problems, they also solve some. One big issue with HTML is that different web browsers have different implementations of the standard. This is a well-known issue: Testing a web page for all major web browsers on all major operating systems can be a real hassle. On the other hand, Silverlight as a plug-in is guaranteed to run the same in every supported web browser. It is the old “write once, run anywhere.”

The major issue that HTML5 faces is that a wide adoption will take a lot of time. Also, if we learned anything from the past, it is that each browser is likely to offer a slightly different feature set. Some features will simply be missing from some browsers; other features will be implemented in a different manner. Compatibility will take a lot of time, if it is ever achieved. In the meantime, and until we know whether HTML5 really delivers what it promises, Silverlight offers a real alternative.

Out of the Browser

Running a Silverlight application out of the browser is similar to running a desktop application. Therefore, Silverlight can be seen as an alternative to any desktop technology, including “classic” MFC and Windows Forms applications on Windows or Mac applications on Mac OS. Let’s just take a look at two modern desktop technologies.

Windows Presentation Foundation

When Silverlight functionalities are not enough to accomplish what you want, the answer is probably to look into WPF, Silverlight’s “big sister.” Even though the convergence is always greater between these two technologies, and Silverlight becomes richer and steps on WPF’s playground, there are still some scenarios for which Silverlight is not suitable.

Tip

Deploying WPF on the Web

Did you know that WPF applications can be deployed and installed from a web server using the ClickOnce technology? See http://www.galasoft.ch/sl4-clickonce.

Also, a WPF application can be deployed and run inside some web browsers on Windows, and provide an interesting alternative to Silverlight. See http://www.galasoft.ch/sl4-xbap.

The biggest disadvantage of WPF with regard to Silverlight is that it runs only on Windows systems. Also, it requires the complete .NET framework (instead of the Silverlight subset), which is larger and takes more time to install on the target machine if it is not already present. Finally, although WPF is richer than Silverlight, this richness also makes it more complicated to learn. It is easier to start with Silverlight.

Note that thanks to the combined efforts of the Silverlight team and the WPF team at Microsoft, the compatibility between both technologies has never been greater, and it is in fact possible to convert a Silverlight application to WPF with a large portion of shared code. Generally speaking, however, and because Silverlight is a subset of .NET, it is easier to start in Silverlight and extend the application to WPF than the contrary. Similarly, it is also easier to start learning Silverlight and then to move to WPF.

Adobe AIR

A less well-known platform developed by Adobe is called AIR and allows creating desktop applications. As such, it is not a concurrent of “in-browser” Silverlight, but rather of the out-of-the-browser applications.

For users, AIR applications are known to be heavy in memory consumption, and require an additional framework that must be installed the first time you run an AIR application (even if you have Flash already installed). This can be a problem on corporate networks, where IT departments are often reluctant to install new components on users’ PCs. Silverlight, on the other hand, is installed once and gets the out-of-the-browser capabilities immediately.

Legacy Technologies

Some technologies are still running inside some web browsers, but are becoming obsolete with time. The two mentioned in this section are not the only ones, but they are the best known, and it is possible that a developer starting a new project will be asked to consider these in the variant analysis.

Java Applets

Java as a plug-in is quite widespread and allows small applications known as applets to run in the web browser. Java was revolutionary in that way when it was released, but it suffers from a lot of issues:

• Java is notoriously slow. It’s slow to install on a new computer, and especially slow to start.

• Java applets have a bad reputation when it comes to security. This claim might not be as true in newer versions as it used to be, but Java’s adoption in the corporate world has suffered a lot from this concern.

• Java is cumbersome for .NET developers. The tools and the language are unusual and require additional training.

Silverlight addresses these concerns and offers a convincing alternative to Java applets. Perhaps the most compelling argument is that Silverlight is .NET. If your developers already know .NET-based client application technologies (WPF, Windows Forms, ASP.NET, and so on), they will feel at home very fast with Silverlight, and have a solid foundation to build on.

Microsoft ActiveX

Similarly to Java applets, ActiveX controls were once very popular to enrich a web page, but are rendered pretty much obsolete nowadays by the many improvements made to new technologies, and especially Silverlight. If you are a developer or maintainer of ActiveX controls, it is probably time to consider moving to the newer, richer, and safer platform that Microsoft is developing. ActiveX controls suffer from the same problems as Java applets regarding security and restrictions in the enterprise world; in addition, they run only on Windows-based operating systems, which prevents a large user base from using them.

Silverlight differs significantly from ActiveX, and converting existing applications to this new technology is not the easiest task a developer can dream of. With this step, however, you will offer a newer, richer, and much friendlier interface to your users, and make a big step toward the future of software development.

A Short History of Silverlight

The development of Silverlight has been consistently incremental. Silverlight 4 is a superset of Silverlight 3, which is a superset of Silverlight 2. Some of the code might not be completely compatible between versions, mostly because when some things were missing developers had to use workarounds. After a feature has been added in a later version, however, the workarounds might not work properly anymore, and it is time to upgrade the code to the proper implementation.

In some rare cases, the interface to some functionality might have changed because the team came up with a better implementation. These occurrences are rare, however, and upgrading an application to a newer version of Silverlight should be easy enough.

Silverlight 1.0

This early release of Silverlight (May 2007) was far from complete, and in fact did not support any .NET code; it had to be programmed in JavaScript. It did, however, support a small subset of XAML (eXtensible Application Markup Language), the language used to define the user interface of Silverlight applications.

Tip

Video as an Incentive

Studies have shown that a user is most likely going to accept installing a new plug-in on his computer to watch videos. This is why the main focus has been put on video in Silverlight 1.0.

The main purpose of Silverlight 1.0 was to rapidly create a base of installation for the Silverlight plug-in. Other features were, however, supported in Silverlight 1.0. For example, you could already create some animations. There were no built-in controls (apart from the TextBlock), but using shapes, you could create buttons and other basic building blocks for your application that would trigger JavaScript-based code. For instance, some video players still available today on the Web are entirely written in Silverlight 1.0, without any .NET code.

Tip

Code Name WPF/E

You might have heard the name Windows Presentation Foundation Everywhere, or WPF/E. This was the code name under which Microsoft developed Silverlight, in reference to Windows Presentation Foundation, the rich desktop programming framework included in .NET 3.0 and later. Very soon, however, this name was abandoned in favor of the catchier Silverlight.

Nowadays it is clear that Silverlight 1.0 was just a step on the road to rich interactive applications, and very soon the focus shifted to Silverlight 2, the first .NET-based version.

Silverlight 2

For a very short time, this version was named Silverlight 1.1, but considering the major changes implemented (and also to simplify the versioning process), it made sense to change the version number to a full digit instead.

Silverlight 2 (released shortly before the Professional Developer Conference in October 2008) was revolutionary because it brought for the very first time the .NET framework (as a subset) to other platforms than Windows. It also included a rich set of controls, enhanced video, new tool support, and many other exciting features.

When you study Silverlight 4, you will use a lot of features that were already available in Silverlight 2.

Silverlight 3

This version (again a full-digit increment) was released in July 2009, a mere nine months after Silverlight 2. In this short time, the team managed to bring Silverlight to a more mature version.

Controls and features were added, and the data layer extended to provide a stable foundation for more business-oriented scenarios. At the same time, the existing media layer was extended with new formats being supported, and new powerful effects (known as pixel shaders) being introduced. On the user experience level, it was now possible to transform 2D elements into the 3D space (what was sometimes called “pseudo 3D” or “2.5D”). Animations were pushed further, with smoother and more lifelike movement. Some steps were also taken to enable hardware acceleration (which is a real challenge on mixed platforms such as the ones supported by Silverlight).

It’s also in Silverlight 3 that we saw the out-of-the-browser (OOB) feature for the first time. It was still rather incomplete: For example, the OOB application still couldn’t get any additional permission, so it was pretty limited in its actions. It was also not possible to give a custom look and feel to the OOB window. Still, it was an intriguing first step, and the community’s response was very encouraging.

In short, we wanted more...

And Silverlight 4...

And here we are! Silverlight 4 will not be the final version of this technology, but one thing is sure: If you were still hesitating to invest in Silverlight, now is a great time to start. We know a lot about what Silverlight is, what it can do and cannot do, and we have a quite clear vision of what will happen in the near future. We also have Silverlight experts with (in some cases) two or three years of experience with this technology.

Silverlight 4 is a very stable release. What we predicted when Silverlight 2 was published is proven true today: Silverlight is here to stay, and Microsoft is betting a lot on this technology. In these three years, it went from “Flash contender” to major user interface technology.

According to recent numbers, the Silverlight installation basis grew very fast since Silverlight 2 was released, and you can count on approximately 60% of all the connected computers having Silverlight 3 or Silverlight 4 already installed.2

Previewing the Future of Silverlight

The next burning question, of course, is where Silverlight is going. As usual, predicting the future of any technology is a difficult exercise, as the past few years have proven. The situation on the .NET front is a bit clearer now than it was two years ago, though; so what did we learn?

• Silverlight has strong support at Microsoft. They are pushing it very hard; they release new features at a fast pace, and managed in just a few years to create a very rich framework. This is not going to stop with Silverlight 4; more is coming.

• A convergence is occurring between Silverlight and WPF. More and more features are shared. The movement is toward compatibility, with Silverlight becoming a complete subset of WPF. Not just compatibility of interfaces, but also binary compatibility. We will probably see this happening in the next few years.

2 Source: http://riastats.com

Tip

Not Completely Compatible Yet

Today, Silverlight is already in great part a subset of WPF in terms of interfaces. Many classes that are in Silverlight also exist in WPF. However, some new classes have been added to Silverlight 3 and 4; some of them have made it into WPF 4, some of them are still missing. The situation is not as clean as one would want.

Also, even though we see first steps in that direction, the binary compatibility is still limited.

• There is already a large adoption of Silverlight by developers and firms worldwide. We saw lots of interesting projects in the past few years, and more are coming. We also see a lot of firms that were reluctant to move to WPF embracing Silverlight for their rich application development because it is easier to learn.

• Finally, the installation base has literally exploded, going from approximately 25% for Silverlight 2 to 60% for Silverlight 3 and 4. The smooth update mechanism makes it painless to upgrade Silverlight if needed; and as new applications are being published on the Web, more users are installing Silverlight to access them.

Here’s a quote from Pete Brown, who works for Microsoft as client application evangelist (http://www.galasoft.ch/sl4-convergence):

In the future, it is very likely that both Silverlight and WPF will be a single technology with a single codebase.

So here it is, the probable future of Silverlight and WPF: A continuum framework that can be used on the desktop (very rich clients with full features / rich clients with fewer features and permissions) and in the web browser (very similar to what we have now, but with added functionality).

Installing Silverlight 4 as a User

Installing Silverlight 4 is very easy. For many users, a version of Silverlight might in fact be already installed on their computer. For instance, if you install one of the applications distributed under the label Windows Live (such as Live Messenger, Live Writer, and so on) and keep the default options, Silverlight will be installed on the target PC.

Similarly, Silverlight can be installed by the Windows Update program. This enables administrators to make sure that the latest versions of Microsoft applications are consistently installed in a corporate network. For home users, Windows Update is a great way to make sure that you get notified when a new version of a driver, an application, or a framework (such as Silverlight) is available.

That said, because it is so new, you might not have the latest version of Silverlight and will need to upgrade when you navigate to a Silverlight 4 application in your web browser. Or, you might not have Silverlight installed at all, and here too you will be notified when you reach the page you want to see.

Opening a Silverlight 4 Application

Silverlight applications are always embedded in an HTML page. Opening a Silverlight application for the first time is always a matter of navigating to a web page in a supported web browser.

With the possibility of saving Silverlight applications locally and to run them out-of-the-browser, the startup point might not be a web page anymore, but more classically a shortcut in the Start menu or on the desktop. However, an application may only be installed locally following a user action (for example, a click on a button or a right-click on the application and selecting Install from the Silverlight context menu). It always starts on the web page!

What to Do If Silverlight Is Not Installed?

If Silverlight is not installed at all on the computer you are using (not even an earlier version), you will see an image asking you to install Silverlight, as shown in Figure 1.2. Note, however, that this experience can be customized, and you might see different pages with elaborate designs.

Figure 1.2 Install Microsoft Silverlight.

image

Exploring Silverlight 4 Demos

Now that Silverlight 4 is a little older, it is possible to see some nice samples on the web. To see these demos, you just need to install Silverlight 4 and to navigate to a URL.

Deep Zooming the Matterhorn

The Matterhorn Deep Zoom application was developed by Microsoft Switzerland to celebrate their 20th anniversary in Switzerland. It features multiple gigapixel pictures stitched together and processed in order to be rendered by the DeepZoom technology. We already talked about DeepZoom in Silverlight 2 Unleashed: A composer application prepares a large image by splitting it into a collection of tiles. Multiple resolutions of each tiles are prepared. When the image is loaded in the DeepZoom viewer (powered by Silverlight), the user can zoom in or out (for example using the mouse wheel or, if he has a supported multitouch screen, with a “pinch” gesture).

When the image is zoomed, the DeepZoom viewer dynamically loads the corresponding tiles from the server. To render the experience more dynamic for the user, the tiles are loaded at low resolution first, and then gradually the image is rendered with a finer grain until the maximum resolution is reached.

To start the Matterhorn DeepZoom application (shown in Figure 1.3), navigate to http://www.galasoft.ch/sl4-matterhorn. Clicking on the demo sets the application in full screen. Select one of the pictures and use the mouse’s wheel to zoom in. Notice how the zoom action is smooth, and how the tiles, blurry at first, become sharper as more information is loaded by the application. More information about the pictures can be seen by clicking on the “info” button, which is a nice way to enrich a presentation.

Figure 1.3 The Matterhorn DeepZoom application.

image

Getting Involved Socially with Sobees

In today’s World Wide Web, social networks have gained in popularity to become an unavoidable part of the browsing experience. Many people, however, do not use the social websites but prefer to use a rich aggregator instead. Sobees offer such applications for multiple platforms, including one built in Silverlight 4 and running either in the browser or installed out-of-the-browser. The Sobees application can be used to visualize entries from Twitter, Facebook, MySpace, and LinkedIn within one single window. It is also possible to perform multiple searches on Twitter.

To run the Sobees Silverlight application (shown in Figure 1.4), navigate to http://sobees.com/web. Follow the instructions to connect to the services that you want to aggregate. In order to install the application and run it like a normal Windows (or Mac) application, right click anywhere on the application’s surface and select Install Sobees web alpha onto this computer. After confirming the operation, this creates a shortcut in your Start menu and/or on your desktop that you can use to run the application without starting the web browser.

Figure 1.4 Sobees Silverlight application.

image

Navigating with Bing Maps Streetside and PhotoSynth

Bing maps and the Streetside application are an interesting way to navigate geographical maps and to immerse yourself in a city, either to discover it in advance or to remember where your steps took you. Note that the “classic” Bing maps application uses standard web technologies; to get the Silverlight version, follow the URL: http://www.bing.com/maps/explore.

After the application is loaded, use the mouse wheel to zoom into the map. Note the smooth loading of details, powered by Silverlight. As you zoom in, the level of detail changes, and switches from map view to satellite view. This can be controlled using the “+” and “-” buttons on the bottom of the page (shown in Figure 1.5).

Figure 1.5 Bing maps controls.

image

Two additional features are available in selected areas: Streetside and PhotoSynth.

Exploring the Streets with Streetside

The idea behind Bing maps Streetside is not new but Silverlight provides a very smooth and innovative experience. First, you need to locate a region where Streetside is enabled. Click the second button from the right in the controls at the bottom of the page, as shown in Figure 1.5. This adds a number of blue areas to the map. Use the zoom controls to dive into one of these areas (for example the city of Seattle in the USA).

After entering the Streetside view, you can use the mouse to click around your location and navigate the available area. It is interesting to see how the pictures are deconstructed and reconstructed to provide an impression of speed as the view advances along the streets. It is also possible to press and hold the mouse to pan the picture around, and the mouse wheel to zoom in and out. For example, the Seattle Aquarium building is shown in Figure 1.6.

Figure 1.6 Bing maps Streetside in Seattle.

image

Discovering a Landscape with PhotoSynth

The PhotoSynth technology uses Silverlight to combine multiple pictures taken around a same object (building, monument, landscape, and so forth). To dive into a PhotoSynth from the Bing Maps viewer, look for a small icon as shown in Figure 1.7.

Figure 1.7 PhotoSynth icons.

image

Once the PhotoSynth viewer is started, use the mouse to click on the panes shown in Figure 1.8, in order to see a different view of the same object. The view is composed of multiple pictures stitched together automatically. Silverlight is used to smoothly pass from one picture to another, providing an impression of 3D as the viewer navigates around the object. For more information about PhotoSynth, refer to http://photosynth.net/.

Figure 1.8 PhotoSynth of the Statue of Liberty.

image

Visualizing Information with the Pivot Viewer

The Silverlight Pivot viewer is an innovative way to display large quantities of information and to sort it. Some examples start being published on the Web, for example the page at http://www.galasoft.ch/sl4-pivot which represents all the editions of MSDN magazine since 2000. Using links or a search box, you can refine the search as shown in Figure 1.9 and Figure 1.10.

Figure 1.9 Pivot Viewer: All MSDN editions.

image

Figure 1.10 Pivot Viewer: MSDN editions by popularity, zoomed in.

image

The Pivot Viewer is but one possibility to represent information in a rich manner with Silverlight. In this book, we will work with data often and create rich connected business applications with Silverlight. The power of computation that Silverlight has over classic web solutions, as well as innovative representations such as shown in Figures 1.9 and 1.10 allow creating compelling experiences.

Drawing on the Web with Fantasia

The Fantasia drawing application demonstrates some advanced graphics features of Silverlight 4, such as using loading and modifying pictures, adding effects to a scene, opening pictures from Flickr directly, and saving the result as an image file locally on the computer. We will talk about many of these features, especially in Chapter 16, “Using Effects and Recording Media.” The Fantasia drawing application shown in Figure 1.11 is a nice place to see all these in action, and to realize what advanced graphics features are included in this version of Silverlight. It is available at http://nokola.com/fantasia/.

Figure 1.11 The Fantasia Drawing Application.

image

How Can You Get Involved?

If you are (or want to become) an active Silverlight developer, there are ways to make yourself heard. You can collaborate with your local Microsoft development and platform evangelists, or participate in the forums at http://silverlight.net, the official home page of Silverlight, where you will get all the information needed to get started.

The Silverlight.net website (shown in Figure 1.12) is also where you will find even more information about Silverlight, compatibility, deployment tips, samples to help you get started, and so on.

Figure 1.12 The Silverlight.net landing page.

image

Another great way to get involved in the Silverlight community is to participate in one of the many Silverlight user groups that have been created around the world. You can find more information about the Silverlight community at http://silverlight.net/community.

Finally, many Silverlight experts and members of the Microsoft Silverlight team are on Twitter. You will find their usernames at http://www.galasoft.ch/sl4-twittermvp and http://www.galasoft.ch/sl4-twittermsft.

Summary

This chapter explained what Silverlight has to offer for client application developers in terms of skills reuse (for .NET programmers) and cross-browser, cross-platform compatibility. We talked about a few alternative technologies, both in the web browser and outside. Then we saw how Silverlight evolved in the past few years to become Silverlight 4, and talked about the future. Finally, we installed Silverlight 4 (if it was not there already) and visited a few demos showing off some nice features available in the framework.

In the next chapter, we install the tools that we need to develop Silverlight applications, and take a tour of their features. This will be very important because we will spend many hours in those tools, both in this book and, should you like Silverlight, after you have finished reading.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.96.247