The growing popularity of Web 2.0 applications is increasing user expectations for high-quality web site design, presentation, and functionality. It is into this climate that Microsoft is releasing Silverlight 4, the third and latest iteration of its cross-browser web presentation technology. Beginning Sliverlight 4 in C# brings you to the cutting-edge of Web 2.0 application design and includes plenty of practical guidance to get you started straightaway. Silverlight design tools have important differences compared to those used to create Ajax and JavaScript functionality. Robert Lair takes you on a tour of all the tools, including: Microsoft Expression Design, which plays an important part in creating Silverlight assets. Microsoft Expression Blend, which is used to build user interaction for Silverlight elements. Microsoft Visual Studio, which manages the interaction between designers and developers, providing the coding environment for “nuts and bolts” wiring. Once you’ve mastered the basics, you'll move on to gaining a more in-depth knowledge of some of the new features introduced with Silverlight 4, including H.264 protected content, right-click event handling, a new printing API, and support for the Managed Extensibility Framework. What you’ll learn Discover the tools needed for Silverlight 4 development, the roles each plays, and how they interact to produce a seamless result. Understand the fundamental concepts and techniques that lie at the heart of every successful Silverlight application and how to apply them to your own projects. Explore the new features and coding practices Silverlight gives to you as a developer that sets it apart from other web-development tools. Who this book is for This book is for anyone with an interest in web development. A basic familiarity with web development and simple C# coding is useful, but by no means a requirement. This book will teach you everything that you need to know. Table of Contents Welcome to Silverlight 4 Introduction to Visual Studio 2010 Layout Management in Silverlight Silverlight Controls Data Binding and Silverlight List Controls Silverlight Toolkit Data Access and Networking Navigation Framework Isolated Storage in Silverlight System Integration and Device Support Introduction to Expression Blend Styling in Silverlight Transformations and Animation Custom Controls Printing in Silverlight Deployment
Author(s): Robert Lair
Edition: 3
Publisher: Apress
Year: 2010
Language: English
Pages: 416
Prelim......Page 1
Contents at a Glance......Page 6
Contents......Page 8
About the Author......Page 17
About the Technical Reviewer......Page 18
Acknowledgments......Page 19
How This Book Is Organized......Page 20
The Evolution of the User Interface......Page 23
What Is Silverlight?......Page 26
Benefits of Silverlight......Page 27
Cross-Platform Version of the .NET Framework......Page 28
Small Runtime and Simple Deployment......Page 29
The Silverlight Development Environment......Page 30
New Features in Silverlight 4......Page 32
Summary......Page 33
What Is Visual Studio?......Page 35
Support for Multiple Monitors......Page 36
Zoom Support for Source Editor......Page 37
Improved IntelliSense......Page 38
Add References Performance......Page 39
Reference Highlighting......Page 40
Box Selection......Page 41
Call Hierarchy Window......Page 42
Extension Manager......Page 43
Try It Out: Hello World in Silverlight 4......Page 44
Hosting Your Silverlight Application: Web Site or Web Application?......Page 48
Using a Visual Studio Web Application Project......Page 49
Summary......Page 50
Layout Management......Page 51
The Canvas Panel......Page 52
Try It Out: Using the Canvas Panel......Page 53
Filling the Entire Browser Window with Your Application......Page 57
Try It Out: Using the StackPanel Control......Page 58
Try It Out: Nesting StackPanel Controls......Page 61
The Grid Control......Page 63
Try It Out: Using the Grid Control......Page 64
Try It Out: Nesting a Grid and Spanning a Column......Page 68
The WrapPanel Control......Page 72
Try It Out: Using the WrapPanel Control......Page 73
Try It Out: Using the DockPanel Control......Page 77
Summary......Page 80
Attribute Syntax......Page 81
Attached Properties......Page 82
Nesting Controls Within Controls......Page 83
Handling Events in Silverlight......Page 84
Try It Out: Declaring an Event in XAML......Page 85
Try It Out: Declaring an Event Handler in Managed Code......Page 89
The Border Control......Page 93
Try It Out: Working with the TextBox Control......Page 97
Try It Out: Working with the RadioButton and CheckBox Controls......Page 101
Adding an Extended Control......Page 104
Try It Out: Using the GridSplitter......Page 105
Summary......Page 108
Data Binding......Page 109
Try It Out: Simple Data Binding in Silverlight......Page 110
Try It Out: Element to Element Binding......Page 119
The DataGrid Control......Page 121
Try It Out: Building a Simple DataGrid......Page 122
The Columns Collection......Page 127
DataGridTextColumn......Page 128
DataGridTemplateColumn......Page 129
Try It Out: Building a DataGrid with Custom Columns......Page 130
Default and Custom ListBox Items......Page 136
Try It Out: Building a ListBox with Custom Content......Page 138
Data Binding and String Formatting......Page 140
TargetNullValue and FallBackValue Extensions......Page 142
Summary......Page 143
Mature/SDK Quality Band......Page 145
Preview......Page 146
Installing the Toolkit......Page 147
Accordion......Page 148
Try It Out: Working with the Accordion Control......Page 149
AutoCompleteBox......Page 154
TabControl......Page 156
ViewBox......Page 157
Modal Windows......Page 159
Try It Out: Using the Modal Child Window......Page 160
Summary......Page 170
Data Access in Silverlight Applications......Page 171
Try It Out: Accessing Data Through a WCF Service......Page 172
Accessing Services from Other Domains......Page 183
Accessing Data Through Sockets......Page 184
Summary......Page 186
Frame and Page Object......Page 187
Try It Out: Creating a Silverlight Navigation Application......Page 188
Deep Linking......Page 197
The NavigationService Object......Page 198
Try it Out: Using the NavigationService Object......Page 199
Try it Out: Passing Data to Navigation Pages......Page 201
Try it Out: Uri Mapping and the Navigation Framework......Page 205
Try it Out: Using the Silverlight Navigation Application Template......Page 208
Try it Out: Using Multiple Frames......Page 212
Summary......Page 214
Working with Isolated Storage......Page 215
IsolatedStorageFileStream......Page 216
IsolatedStorageSettings......Page 217
Try It Out: Creating a File Explorer for Isolated Storage......Page 218
Creating the Application Layout......Page 219
Coding the File Explorer......Page 229
Testing the File Explorer......Page 238
Viewing and Clearing Isolated Storage......Page 240
Try It Out: Increasing the Isolated Storage Quota......Page 241
Summary......Page 244
Try It Out: Implementing Toast Notifications.......Page 245
CaptureSource Class......Page 251
Try It Out: Accessing a User’s Web Camera and Microphone......Page 252
COM Interoperability......Page 257
Try It Out: Executing an EXE......Page 258
Try It Out: Enabling an Application As a Drop Target......Page 262
Summary......Page 265
Key Features in Expression Blend......Page 267
Split-View Mode......Page 268
World-Class Timeline......Page 269
Try It Out: Working with Projects in Expression Blend......Page 270
Toolbox......Page 274
Properties Panel......Page 276
Working with the Grid Control in Expression Blend......Page 277
Try It Out: Editing a Layout Grid with Expression Blend......Page 278
Summary......Page 284
Try It Out: Setting Inline Properties with Visual Studio......Page 285
Try It Out: Setting Inline Properties with Expression Blend......Page 293
Silverlight Styles......Page 302
Try It Out: Using Styles As Static Resources......Page 303
Defining Styles at the Application Level......Page 311
Merged Resource Dictionaries......Page 312
Silverlight Style Hierarchy......Page 314
Inheriting Styles Using BasedOn......Page 315
Implicit Styles......Page 316
Summary......Page 318
Introduction to Silverlight Animation......Page 319
Silverlight Storyboards......Page 320
Types of Animations in Silverlight......Page 321
Programmatically Controlling Animations......Page 323
Using Expression Blend to Create Animations......Page 325
Try It Out: Creating an Animation with Expression Blend......Page 326
Creating Transformations in Silverlight......Page 334
ScaleTransform......Page 335
TranslateTransform......Page 336
Try It Out: Using Expression Blend to Transform Silverlight Objects......Page 337
Summary......Page 341
When to Write Custom Controls......Page 343
Parts and States Model......Page 344
Dependency Properties......Page 345
Try It Out: Building a Custom Control......Page 346
Setting Up the Control Project......Page 347
Defining Properties and States......Page 349
Defining the Control’s Appearance......Page 352
Handling Control Events......Page 356
Compiling and Testing the Control......Page 361
Summary......Page 363
Try It Out: Implementing Simple Printing......Page 365
Try It Out: Implementing a Custom Print......Page 373
Try It Out: Handling the BeginPrint and EndPrint Events......Page 376
Summary......Page 379
Hosting Silverlight Content......Page 381
Application Library Caching......Page 382
Try It Out: Exploring Assembly Caching......Page 383
Full Screen Pinning......Page 386
Out of Browser Support......Page 387
Customizing the Install Application Dialog......Page 389
Out of Browser API......Page 391
Removing Installed Applications......Page 392
Elevated Trust Applications......Page 393
Summary......Page 396
¦A......Page 397
¦B......Page 398
¦C......Page 399
¦......Page 401
¦E......Page 403
¦F......Page 404
¦G......Page 405
¦......Page 406
¦J......Page 407
¦......Page 408
¦O......Page 409
¦P......Page 410
¦R......Page 411
¦T......Page 414
¦U......Page 415
¦W......Page 416
¦......Page 417