𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Silverlight 2.0 for ASP.NET developers

✍ Scribed by Swift, Jonathan;Alvarez, Salvador;Barker, Chris;Wahlin, Dan


Publisher
Wrox Press; Wiley
Year
2009;200u
Tongue
English
Leaves
676
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Our overarching goal in writing this book was to give ASP.NET developers the power to quickly and easily create visually stunning Internet applications, coupled with rich interactivity to fully immerse the user in a new online experience. Silverlight gives you everything you need to do just this, and in serious style!

As well as taking you through each feature that ships with Silverlight, this book will make sure you're able to debug, troubleshoot, and performance-tune your Silverlight applications, as well as seamlessly hook into your existing ASP.NET architecture and code base.

This book is aimed at .NET developers and architects who want to quickly get up to speed with all that Silverlight 2 has to offer.

As well as covering the breadth of features that Silverlight 2 provides, this book makes a point of demonstrating where necessary how the particular feature can be integrated tightly with the ASP.NET host application. An example is in Chapter 7, where the ASP.NET Profile service is utilized directly from within Silverlight to obtain user-specific data.

It's fair to say that although this book is aimed at ASP.NET developers, it covers all of the salient features of Silverlight 2 to the degree that it's a useful programming resource for developers not using ASP.NET also.

If you're fresh to .NET development, however, you might want to check out a beginning .NET book first, to help you overcome the syntax and set-up queries when learning a new language. Otherwise, take a deep breath and dive in!

This book covers the full feature set of Silverlight 2, diving into each of the subject areas to give depth and breadth coverage. As well as teaching you about the component parts of the Silverlight API, the book also covers debugging, troubleshooting, and performance-tuning your Silverlight applications, arming you with all the skills and knowledge you'll need to create advanced Silverlight-based applications in record time.

Importantly, this book covers the integration points between ASP.NET and Silverlight, taking you through the different techniques you can use to seamlessly augment your existing or new ASP.NET web sites with the power of Silverlight.

If you want to program in Silverlight and potentially use ASP.NET as the host, then this book covers it all.

The book is split into two distinct parts. Part I is titled "Silverlight Fundamentals for ASP.NET Developers," and Part II is titled "Developing ASP.NET Applications with Silverlight." Part I is intended to give you grounding in what Silverlight is as a technology and how it fits into the Web-based landscape. The component pieces of a Silverlight application are also laid out at a high level, and any knowledge required before putting an application together is explained.

Part II is written to give you depth of knowledge across the Silverlight feature-set and show you how to leverage the power of both Silverlight and ASP.NET to create compelling applications.

A brief synopsis of the content follows:

"Silverlight in a Nutshell"--This will teach you at a high level what Silverlight is and how it can help you deliver engaging, immersive web applications. Differentiating Silverlight from other Web-based technologies is also covered here, and a description of the required development environment is provided. In short, after reading this, you'll be able to describe Silverlight and explain why you'd want to use it and what gives it the edge over the competition.

"Silverlight Architecture"--Silverlight allows you to rapidly build a well-rounded application with a great user interface, but if you encounter any problems during development, it is going to be important for you to understand the underlying architecture upon which you are developing. This outlines the core features of Silverlight 2 and guides you around the building blocks of this highly flexible framework, paying particular attention throughout to your ASP.NET heritage.

"XAML Condensed"--Quickly getting up to speed with XAML is what this is all about, helping you brush aside the syntax queries and get to grips with the basics of this multi-purpose declarative language. Hooking the XAML files up to .NET code is also shown here, helping you inject dynamic event-driven actions into your Silverlight UI. Finally, one technique for the dynamic creation of XAML is shown, followed by a tour of Expression Blend.

"Programming Silverlight"--By the time you get here, you'll be itching to start coding, and code you will as the feature-agnostic programming constructs that make up a Silverlight application are covered in detail. The composition of a Silverlight application is laid bare and its constituent parts explained at length, as well as detailing the Silverlight application lifetime and how to hook into it. The different options for embedding the Silverlight plug-in within your application are covered, followed by a brief overview of JavaScript and its associated DOM. This then leads onto a discussion of the Silverlight Object Model, explaining how the visual tree is constructed to form the UI. Another technique for dynamically creating XAML and adding it to the visual tree is also shown here. Finally, the Silverlight event model, browser interaction, and threading model are covered for you.

"Creating the User Interface"--You now know how to program Silverlight and how to write XAML. This shows you how to put it all together to start laying out the user interface of your Silverlight application. Each of the layout controls that ship with Silverlight is covered here--Canvas, Grid, StackPanel, and TabControl--including information on when to use which one. Information on how to create a scalable UI is also provided, followed finally by a section that details how to localize your application, thereby making it available to other languages and cultures.

"Silverlight Controls"--Silverlight 2 provides an assortment of controls that can be used to display and capture data. In this, you'll learn to work with user input controls, items controls, and media controls and see how they can be put to use to build interactive and rich user interfaces. You'll also learn how to use controls such as the MultiScaleImage control to work with Silverlight's Deep Zoom technology.

"Styles and Templates"--Altering the look and feel of your application is the crux here, with the different techniques for applying styling information to the controls that comprise it demonstrated here. As well as this, integrating with the ASP.NET Profile service via WCF is detailed, giving you the ability to personalize your Silverlight application on a per-user basis.

"User Interaction"--What's the point of having a great technology like Silverlight 2 if we can't interact with it? We review the different ways that you can interact with your application, understanding how the UIElements work with input devices like the keyboard, mouse, and stylus. We also explore the different ways to navigate around the application and present the different options that we have and in which scenarios each one is preferred.

"Communicating with the Server"--The ability to access data located at distributed sources is key in many Silverlight 2 applications. You learn different networking technologies that are available and see how they can be put to use. Several different topics are covered such as creating and calling ASMX and WCF services, calling REST APIs, working with JavaScript Object Notation (JSON) data, pushing data from a server to a client with sockets, and leveraging HTTP Polling Duplex functionality.

"Working with Data"--It is all about data! One of my colleagues always says, "If you are not using data binding in Silverlight 2, you are doing something wrong!" This explains the data framework available within your applications and then deeps dive into the inner workings of data binding, showing you the different approaches that you may take. In order to understand how the data is retrieved, we explain the different technologies and techniques to get the most of Silverlight 2 data using the available data controls. Finally, this explains how you can manipulate the data using LINQ and LINQ to XML.

"Creating Custom Controls"--This will take you on a journey in order to discover the different options that you have available to customize the Silverlight 2 controls. We start exploring the user control model that ASP.NET developers are used to, and then we dig into the internals of visual customization. You will be amazed by this powerful new model. Finally, for those who need to push the technology to the limit, this explains how to create a complete custom control from scratch.

"Securing Your Silverlight Application"--Whether you're an Enterprise developer or a Silverlight hobbyist, you are going to want to release your application out to the wild at some point. In doing so, you are providing a high level of exposure to your application, and therefore security should not be an afterthought. Thankfully, Silverlight 2 has a security framework built into the run time, which will give you the peace of mind of working within a secure environment. This introduces you to the Silverlight security framework, but also talks you through your security responsibilities as a Silverlight developer.

"Audio and Video"--Embedding high-fidelity audio and video in your Silverlight application is sure to capture your users' imaginations, and this shows you how you can do just this using the Silverlight-provided MediaElement control and the ASP.NET Media Server Control. Playback control is demonstrated, as is the more advanced topic of providing synchronization points within your chosen media. This will definitely help you put the WOW factor into your web sites.

"Graphics and Animation"--A detailed tour of the graphics API that ships with Silverlight is first discussed here, including the Shape-derived objects that can be rendered to screen and also the Geometry-derived objects that can be created and then rendered via a Path object. Brush objects are covered next, demonstrating the SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush, and VideoBrush, and their usage. Next up is the very cool DeepZoom technology, covering the creation of DeepZoom-enabled images using the DeepZoom Composer and their usage in your Silverlight application via the MultiScaleImage control. Finally, the different animation techniques that you can use within your Silverlight application are covered, ranging from the basic From/To/By type to the more advanced Key frame types, including the different transition mechanisms within.

"Troubleshooting Silverlight Applications"--Writing an application from start to finish without any development issues is still quite some way off. This introduces you to a range of techniques and tools to help you through the hard times when your application isn't behaving as you would expect it to. Besides retrospectively fixing problems within your application, this concludes with the more proactive approach of ensuring that your application hits a known quality bar before you are satisfied that it is ready to be released. Silverlight's testing framework is the flavor of the day here.

"Performance"--Silverlight is an incredibly powerful and flexible framework. Its inherent flexibility often means that there are several ways to achieve your goals. In choosing an alternative path, you will often find that the penalty is poor performance. This gives a series of best-practice advice to allow you to make an informed decision when you hit those forks in the road. In addition, you will learn how to instrument your code in order to simply identify the bottlenecks within your application.

To get the most out of this book, it's recommended that you code along with the examples provided, either by copying the code shown in the chapters or by downloading the samples and running them yourself.

To do this, you're going to need Visual Studio 2008, which is available to download from MSDN, provided you have a subscription. As well as this, you'll also need to download and install the Silverlight Tools for Visual Studio 2008, which allows you to create Silverlight-based applications within Visual Studio. This install will also take care of installing the Silverlight run time and SDK for you. You can download this installer fromwww.silverlight.net/getstarted.

If you want to follow the examples that use Microsoft Expression Blend or the Deep Zoom Composer, you can also download these fromwww.silverlight.net/getstarted.

As well as these software requirements, you will need a basic working development knowledge of Microsoft .NET and have experience in Web-based development. A passion for creating rich web applications is advantageous, although not necessary!

✦ Table of Contents


Professional Silverlight 2 for ASP.NET Developers......Page 1
About the Authors......Page 10
Credits......Page 11
Acknowledgments......Page 12
Contents......Page 15
Who This Book Is For......Page 23
How This Book Is Structured......Page 24
Conventions......Page 27
p2p.wrox.com......Page 28
Part I: Silverlight Fundamentals for ASP. NET Developers......Page 31
Uphill Struggle......Page 33
Silverlight Steps In......Page 34
What You Should Still Do in ASP.NET......Page 36
The Development Environment Overview......Page 37
Summary......Page 38
Client/Server Architecture Overview......Page 39
Platforms......Page 40
Architecture......Page 42
ASP.NET Integration......Page 54
Application Life Cycle......Page 57
Summary......Page 59
Why All ASP.NET Developers Should Know the Basics......Page 61
XAML Syntax and Terminology......Page 63
Piecing It All Together......Page 87
Summary......Page 91
How a Silverlight Application Is Composed......Page 93
JavaScriptβ€”How Much You Need to Know......Page 106
JavaScriptβ€”The Basics......Page 107
The Silverlight Object Model......Page 114
Events, Threading, and Browser Interaction......Page 120
On-Demand XAP Loading......Page 144
Summary......Page 146
Part II: Developing ASP. NET Applications with Silverlight......Page 149
Expression Suiteβ€”A Whirlwind Tour......Page 151
ASP.NET versus Silverlight Layout......Page 160
Summary......Page 195
Chapter 6: Silverlight Controls......Page 197
Introduction to Silverlight Controls......Page 198
User Input Controls......Page 202
Items Controls......Page 218
Media Controls......Page 228
Silverlight Toolkit Controls......Page 235
Summary......Page 242
Styles......Page 243
Templating......Page 254
Integrating with ASP.NET......Page 265
Summary......Page 272
The Silverlight Interaction Context......Page 273
Navigation......Page 296
Summary......Page 313
Silverlight Networking and Communication Features......Page 315
Cross-Domain Support......Page 319
Creating Services for Silverlight......Page 322
Calling Services with Silverlight......Page 334
Calling REST APIs......Page 340
Summary......Page 389
Chapter 10: Working with Data......Page 391
Data Framework......Page 392
Data-Binding Essentials......Page 395
Retrieving and Storing Data......Page 417
Data Controls......Page 431
Manipulating Data......Page 437
Validation......Page 446
Summary......Page 450
User Controls......Page 453
Customizing Current Controls......Page 465
Custom Controls......Page 477
Summary......Page 490
You’re under Attack!......Page 491
The Security Model......Page 493
Working in a Sandbox......Page 496
Integrating with ASP.NET Security......Page 500
Obfuscation......Page 508
Summary......Page 509
First Steps......Page 511
Finer Control......Page 521
Summary......Page 544
Breathing Life into ASP.NET......Page 545
Graphics in Silverlight......Page 546
Image Handling......Page 570
Animating Your User Interface......Page 577
Summary......Page 586
Chapter 15: Troubleshooting......Page 589
Common Types of Problems......Page 590
Your Toolkit......Page 592
Reducing the Likelihood of Problems......Page 606
Summary......Page 617
Chapter 16: Performance......Page 619
Performance Bottlenecks......Page 620
Instrumentation......Page 621
Improving Performance......Page 626
Summary......Page 649
Index......Page 651


πŸ“œ SIMILAR VOLUMES


Professional Silverlight 2 for ASP.NET D
✍ Jonathan Swift, Salvador Alvarez Patuel, Chris Barker, Dan Wahlin πŸ“‚ Library πŸ“… 2009 πŸ› Wrox 🌐 English

Our overarching goal in writing this book was to give ASP.NET developers the power to quickly and easily create visually stunning Internet applications, coupled with rich interactivity to fully immerse the user in a new online experience. Silverlight gives you everything you need to do just this, an

ASP.NET 2.0 Everyday Apps for Dummies
✍ Doug Lowe πŸ“‚ Library πŸ“… 2006 πŸ› Wiley Publishing 🌐 English

ASP.NET 2 Everyday Apps For Dummies is written in the For Dummies friendly, easy-to-understand style. It shows those with some web development experience how to create Web sites and applications. The uniqueness of the book lies in the fact that everything you need to "bake the pie" is provided from

ASP.NET 2.0 Everyday Apps For Dummies
✍ Doug Lowe πŸ“‚ Library πŸ“… 2006 πŸ› Wiley Publishing 🌐 English

Create a shopping cart, online store, and Web forum, or set up a blog ASP.NET 2.0 is a functional programming tool, so why not discover how to use it by actually creating something functional? These aren't useless ''Hello World'' type examples - you'll build secure e-commerce, community, an

ASP.NET 2.0 Everyday Apps For Dummies
✍ Doug Lowe πŸ“‚ Library πŸ“… 2006 πŸ› Wiley Publishing 🌐 English

Create a shopping cart, online store, and Web forum, or set up a blog ASP.NET 2.0 is a functional programming tool, so why not discover how to use it by actually creating something functional? These aren't useless ''Hello World'' type examples - you'll build secure e-commerce, community, an

Beginning Web Development Silverlight An
✍ Laurence Moroney πŸ“‚ Library πŸ“… 2008 πŸ› Apress 🌐 English

Beginning Web Development, Silverlight, and ASP.NET AJAX: From Novice to Professional aims to give you the skills you need to start building web applications with Microsoft’s next–generation technology as quickly as possible. Whether you’re interested in ASP.NET AJAX, Silverlight, or the technologie