Skip to main content

Über dieses Buch

Silverlight 5 is the latest iteration of Microsoft's cross-browser technology for creating rich user experiences on the Web. Like its predecessor, it rides atop the .NET Framework for maximum ease of use and coding efficiency. The new technology carries forward much of the work that has been done before and augments it in many important respects, including support for H.264 video, major improvements to the graphics engine (including true 3D rendering), and much richer data-binding options for interfacing with other applications.

Pro Silverlight 5 in C# is an invaluable reference for professional developers who want to discover the new features of Silverlight. Author Matthew MacDonald's expert advice guides you through creating rich media applications using Silverlight in the environment you're most productive in—no matter what the target platform. As you learn about the features that put Silverlight in direct competition with Adobe Flash, such as rich support for 2D and 3D drawing, animations, and media playback, you'll experience the plumbing of .NET and the design model of WPF through Silverlight—all of the same .NET technology that developers use to design next-generation Windows applications.

Pro Silverlight 5 in C# is a comprehensive tutorial, written from professional developer to professional developer.

Please note: the print version of this title is black & white; the eBook is full color.



Chapter 1. Introducing Silverlight

In the introduction, you learned about the design philosophy that underpins Silverlight. Now, you’re ready to get your hands dirty and create your first Silverlight application.

Matthew MacDonald

Chapter 2. XAML

XAML (short for Extensible Application Markup Language and pronounced


) is a markup language used to instantiate. NET objects. Although XAML is a technology that can be applied to many different problem domains, it was initially designed as part of Windows Presentation Foundation (WPF), where it allows Windows developers to construct rich user interfaces. You use the same standard to build user interfaces for Silverlight applications.

Matthew MacDonald

Chapter 3. Layout

Half the battle in user interface design is organizing the content in a way that’s attractive, practical, and flexible. In a browser-hosted application, this is a particularly tricky task, because your application may be used on a wide range of different computers and devices (all with different display hardware), and you have no control over the size of the browser window in which your Silverlight content is placed.

Matthew MacDonald

Chapter 4. Dependency Properties and Routed Events

At this point, you’re probably itching to dive into a realistic, practical example of Silverlight coding. But before you can get started, you need to understand a few more fundamentals. In this chapter, you’ll get a whirlwind tour of two key Silverlight concepts:

dependency properties


routed events


Matthew MacDonald

Chapter 5. Elements

Now that you’ve learned the fundamentals of XAML, layout, and mouse and keyboard handling, you’re ready to consider the elements that allow you to build both simple and complex user interfaces.

Matthew MacDonald

Chapter 6. The Application Model

Over the past five chapters, you’ve taken a detailed look at the different visual ingredients you can put inside a Silverlight page. You’ve learned how to use layout containers and common controls and how to respond to mouse and keyboard events. Now, it’s time to take a closer look at the Silverlight

application model

—the scaffolding that shapes how Silverlight applications are deployed, downloaded, and hosted.

Matthew MacDonald

Chapter 7. Navigation

With the know-how you’ve picked up so far, you’re ready to create applications that use a variety of different controls and layouts. However, there’s still something missing: the ability to transition from one page to another. After all, traditional rich-client applications are usually built around different windows that encapsulate distinct tasks. To create this sort of application in Silverlight, you need a way to move beyond the single-page displays you’ve seen so far.

Matthew MacDonald

Chapter 8. Shapes and Transforms

Silverlight’s 2-D drawing support is the basic foundation for many of its more sophisticated features, such as custom-drawn controls, interactive graphics, and animation. Even if you don’t plan to create customized art for your application, you need to have a solid understanding of Silverlight’s drawing fundamentals. You’ll use it to add professional yet straightforward touches, such as reflection effects. You’ll also need it to add interactivity to your graphics—for example, to make shapes move or change in response to user actions.

Matthew MacDonald

Chapter 9. Brushes, Bitmaps, and Printing

In the previous chapter, you started your exploration into Silverlight’s 2-D drawing model. You considered how you can use Shape-derived classes such as Rectangle, Ellipse, Polygon, Polyline, and Path to create a variety of different drawings. However, shapes alone fall short of what you need to create detailed 2-D vector art for a graphically rich application. In this chapter, you’ll pick up the missing pieces.

Matthew MacDonald

Chapter 10. Animation Basics

Animation allows you to create truly


user interfaces. It’s often used to apply effects—for example, icons that grow when you move over them, logos that spin, text that scrolls into view, and so on. Sometimes, these effects seem like excessive glitz. But used properly, animations can enhance an application in a number of ways. They can make an application seem more responsive, natural, and intuitive. (For example, a button that slides in when you click it feels like a real, physical button—not just another gray rectangle.) Animations can also draw attention to important elements and guide the user through transitions to new content. (For example, an application could advertise new content with a twinkling, blinking, or pulsing icon.)

Matthew MacDonald

Chapter 11. Advanced Animation

You now know the fundamentals of Silverlight’s property animation system—how animations areYou now know the fundamentals of Silverlight’s property animation system—how animations areYou now know the fundamentals of Silverlight’s property animation system—how animations are defined, how they’re connected to elements, how you can control playback with a storyboard, and how you can incorporate animation easing to create more realistic effects. Now is a good time to take a closer look at the practical animation techniques you can use in an application.

Matthew MacDonald

Chapter 12. Sound, Video, and Deep Zoom

In this chapter, you’ll tackle one of Silverlight’s most mature features: audio and video support.

Matthew MacDonald

Chapter 13. Silverlight 3D

As you already know, Silverlight began its life as a subset of the features, classes, and capabilities found in the WPF library. Long before Silverlight was released, the technology was first called WPF/E (shorthand for “WPF for Everyone”).

Matthew MacDonald

Chapter 14. Styles and Behaviors

Silverlight applications would be a drab bunch if you were limited to the plain, gray look of ordinary buttons and other common controls. Fortunately, Silverlight has several features that allow you to inject some flair into basic elements and standardize the visual appearance of your application. In this chapter, you’ll learn about two of the most important: styles and behaviors.

Matthew MacDonald

Chapter 15. Control Templates

In the previous chapter, you learned how to use styles and behaviors to reuse user-interface property settings and code. In this chapter, you’ll explore two more powerful tools: control templates and custom controls.

Matthew MacDonald

Chapter 16. Multithreading

One of Silverlight’s least expected surprises is its support for


—the fine art of executing more than one piece of code at the same time. It’s a key part of the full. NET Framework and a commonly used feature in rich client applications built with WPF and Windows Forms. However, multithreading hasn’t appeared in the toolkit of most browser-based developers, and it’s notably absent from both JavaScript and Flash.

Matthew MacDonald

Chapter 17. Browser Integration

Because Silverlight applications run in their own carefully designed environment, you’re insulated from the quirks and cross-platform headaches that traditionally confront developers when they attempt to build rich browser-based applications. This is a tremendous advantage. It means you can work with an efficient mix of C# code and XAML markup rather than struggle through a quagmire of HTML, JavaScript, and browser-compatibility issues.

Matthew MacDonald

Chapter 18. Out-of-Browser Applications

As you already know, the code for every Silverlight application is contained in a XAP file. The Silverlight browser plug-in downloads this file from the web server and executes it on the client. After this point, there’s no requirement for the web server to get involved again—all the code runs on the local computer.

Matthew MacDonald

Chapter 19. ASP.NET Web Services

Many of the most interesting Silverlight applications have a hidden backbone of server-side code. They may call a web server to retrieve data from a database, perform authentication, store data in a central repository, submit a time-consuming task, or perform any number of other tasks that aren’t possible with client-side code alone. The common ingredient in all these examples is that they are based on

web services

—libraries of server-side logic that any web-capable application can access.

Matthew MacDonald

Chapter 20. Data Binding

Data binding

is the time-honored tradition of pulling information out of an object and displaying it in your application’s user interface, without writing the tedious code that does all the work. Often, rich clients use


data binding, which adds the ability to push information from the user interface back into some object—again, with little or no code.

Matthew MacDonald

Chapter 21. Data Controls

So far, you’ve learned how to use data binding to pull information out of data objects, format it, and make it available for editing. However, although data binding is a flexible and powerful system, getting the result you want can still take a lot of work. For example, a typical data form needs to bind a number of different properties to different controls, arrange them in a meaningful way, and use the appropriate converters, templates, and validation logic. Creating these ingredients is as time-consuming as any other type of UI design.

Matthew MacDonald

Chapter 22. File Access

Silverlight includes a surprisingly capable set of features for saving, reading, and managing files. The key fact you need to understand is that ordinary Silverlight applications aren’t allowed to write to (or read from) arbitrary locations on the file system. Instead, Silverlight applications that need to store data permanently must use a feature called

isolated storage


Matthew MacDonald

Chapter 23. Networking

Like most software, Silverlight applications need to interact with the outside world to get relevant, current information. You’ve already seen one tremendously useful way to pull information into a Silverlight application: using WCF services, which allow Silverlight applications to retrieve data from the web server by calling a carefully encapsulated piece of. NET code. However, WCF services won’t provide all the data you need to use. In many situations you’ll want to retrieve information from other non-.NET repositories, such as representational state transfer (REST) web services, RSS feeds, and ordinary HTML web pages.

Matthew MacDonald


Weitere Informationen

Premium Partner

Neuer Inhalt

BranchenIndex Online

Die B2B-Firmensuche für Industrie und Wirtschaft: Kostenfrei in Firmenprofilen nach Lieferanten, Herstellern, Dienstleistern und Händlern recherchieren.



Best Practices für die Mitarbeiter-Partizipation in der Produktentwicklung

Unternehmen haben das Innovationspotenzial der eigenen Mitarbeiter auch außerhalb der F&E-Abteilung erkannt. Viele Initiativen zur Partizipation scheitern in der Praxis jedoch häufig. Lesen Sie hier  - basierend auf einer qualitativ-explorativen Expertenstudie - mehr über die wesentlichen Problemfelder der mitarbeiterzentrierten Produktentwicklung und profitieren Sie von konkreten Handlungsempfehlungen aus der Praxis.
Jetzt gratis downloaden!