xii
Contents
Chapter 3: Designing Silverlight Applications Using Expression Blend 2 59
Getting the Latest Blend 2 Preview 60
Creating a New Silverlight Project 60
The Silverlight Project Starter Template 61
Blend Workspace Overview 62
Layout and Design in Blend 74
Creating and Understanding Timelines 79
Understanding Storyboards in Silverlight 80
Creating a Timeline 80
Working with Artwork Created Outside of Blend 84
Designing with Blend/Silverlight in Mind 84
Exporting to XAML in Other Tools 86
Summary 89
Chapter 4: Coding Silverlight Applications with JavaScript and XAML 91
The JavaScript Programming Model 92
Creating the Player Using JavaScript 92
Refactoring the Silverlight Player Creation 95
Dissecting the Silverlight.js Helper Library 96
createObject and createObjectEx 96
isInstalled 103
Accessing the Silverlight Player Object 104
Accessing XAML Content 105
Locating XAML Content Elements 105
Getting and Setting XAML Properties 106
Instantiating and Inserting XAML Elements 108
Examining Events in Silverlight 113
Player Events 113
XAML Element Events 115
Accessing Storyboards Programmatically 125
Using the Downloader Object 128
Downloading Packages 131
Downloading Fonts 133
Using JavaScript and the MediaElement 134
Using DownloadProgressChanged and BufferingProgressChanged Events 136
Working with Markers 137
Summary 138