Essential Silverlight 3- P1 - Pdf 70

ptg
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
Praise for Essential Silverlight 3
“Essential Silverlight 3 is not only filled with technical details, clear examples,
and performance tips that will make any Silverlight application better, but
Ashraf also includes insights that can only come from one of the lead devel-
opers of the Silverlight runtime. From graphics, to text, to media—this book
contains all the information you need on the core Silverlight 3 runtime.”
—Brad Abrams, product unit manager, Microsoft
“The third iteration of Silverlight is a big step forward in true line-of-business
capability for RIAs. Ashraf takes these new concepts and puts them forth
in a meaningful and concise read.”
—Jason Beres, Microsoft MVP; author; INETA Speaker
“Essential Silverlight 3 is truly an essential book in the library of any
Silverlight developer. The ‘Under the Hood’ portions of each chapter
explain the details of Silverlight’s implementation, and the ‘Performance
Tips’ explain how to use that information to get the most out of your soft-
ware. I am very grateful I don’t have to track down or figure out all of this
critical information on my own.”
—Noah Gedrich, director of technology, BLITZ Agency
“Ashraf Michail delivers an insightful and practical book for anyone seeking
to better understand, master, and unlock the full potential of Silverlight 3.
It is filled with code samples, performance tips, and other useful advice to
help you create truly outstanding Silverlight applications.”
—Oleg Kokorin, CEO, MS Team, LLC
“Essential Silverlight 3 tackles in depth a rich, vast platform. The author has
a depth of knowledge and technical insight that is present throughout,
providing a pleasing ‘why’ on top of the usual ‘how.’”
—Richard Leggett, interactive developer

“A must-read for all software developers who are trying to build rich
Silverlight applications with great performance—it provides many useful
performance tips. I would recommend it to anyone trying to improve
performance of Silverlight 3 applications.”
—Radenko Zec, senior software developer, Lanaco; INETA group leader,
Banjaluka, Bosnia and Herzegovina
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
Essential Silverlight 3
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
T
he award-winning Microsoft .NET Development Series was
established in 2002 to provide professional developers with the
most comprehensive, practical coverage of the latest .NET technologies.
Authors in this series include Microsoft architects, MVPs, and other
experts and leaders in the field of Microsoft development technologies.
Each book provides developers with the vital information and critical
insight they need to write highly effective applications.
Visit informit.com/msdotnetseries for a complete list of available products.
Microsoft
®
.NET Development Series
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
Ashraf Michail
Essential

Essential Silverlight 3 / Ashraf Michail.
p. cm.
Includes index.
ISBN 978-0-321-55416-1 (pbk. : alk. paper) 1. Silverlight (Electronic resource) 2. Multimedia systems.
3. Websites—Design. 4. Application software—Development.
I. Title.
QA76.575.M52187 2009 2009
006.7—dc22
2009026788
Copyright © 2010 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and
permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval
system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or
likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
ISBN-13: 978-0-321-55416-1
ISBN-10: 0-321-55416-7
Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana.
First printing, September 2009
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
To my mother, for a lifetime of encouragement.
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg

ptg
Networking 9
Under the Hood 9
Where Are We? 10
2 Applications 11
Application Principles 11
Web Deployment and Out of Browser 12
Platform Libraries 12
Designer and Developer Collaboration 13
Cross Platform 13
Security 14
Creating an Application in Visual Studio 14
Application Components 15
Taking an Application Out of Browser (New in Silverlight 3) 21
XAML 22
XAP Package 30
Under the Hood 32
Architecture Overview 32
Silverlight Plug-In 33
Downloader 34
XAML Parser 35
.NET Common Language RunTime 36
Element Tree 36
Event System 37
Animation 37
Layout 38
Rendering 39
Where Are We? 39
3 Graphics 41
Graphics Principles 41

Rendering for Readability 99
Text Elements 99
TextBlock 100
Glyphs 107
Under the Hood 110
Font Enumeration 110
Font Fallback 111
Font Download 111
Caches 112
Rasterization 112
Where Are We? 113
5 Input Events 115
Input Principles 115
Receiving Web Browser Events 116
xi
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
Contents
Custom Controls 117
Cross-Platform Consistency 117
Multiple Languages 118
Input Events 118
Mouse Input Events 120
Keyboard Events and Focus 126
Under the Hood 128
Mouse Events 128
Keyboard Events 129
Asynchronously Firing Events 129
Where Are We? 130

StackPanel 161
Grid 162
Layout Rounding 167
Building a Custom Layout 169
Layout Events 173
Under the Hood 174
The Layout Algorithm 174
Where Are We? 176
8 Media 177
Media Principles 178
Integrate Media 178
Deliver Content 178
Deliver Full Screen Experiences 179
Generate Players with Expression Media Encoder 180
Media Elements 180
Play a Video 180
Making Player Controls 183
Video Effects and Transitions 187
Full Screen 188
Connecting Video Markers to Application Display 189
Under the Hood 190
The Source 190
The Player 191
Where Are We? 193
9 Controls 195
Control Principles 196
Built-In Controls 196
Custom Controls 198
Customization 198
Control Elements 198

11 Effects 233
Effect Principles 233
Real-Time Speed 233
Common Built-In Effects 234
Effect Elements 234
Applying an Effect 234
Creating an Effect 236
Under the Hood 248
Surface Generation 248
BlurEffect and DropShadowEffect 249
Where Are We? 250
xiv
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
Contents
12 GPU Acceleration 251
GPU Acceleration Principles 251
Achieve Better Performance for Common Scenarios 252
Maintain Good Image Quality 252
Maintain Reasonable Stability 252
GPU Acceleration Features 253
GPU Acceleration Prerequisites 253
Enable GPU Acceleration 253
Using the CacheMode Property 254
Diagnose Performance Problems 259
Under the Hood 263
Graphics Device Creation 263
Texture Creation 264
Rendering Stages with GPU Acceleration Enabled 265

F
IGURE
2.2:
Hello World application 16
F
IGURE
2.3:
Application install menu 22
F
IGURE
2.4:
Application install prompt 22
F
IGURE
2.5:
Application running outside the Web browser 23
F
IGURE
2.6:
Example path 25
F
IGURE
2.7:
Architectural Overview 33
F
IGURE
2.8:
Layout Example 38
F
IGURE

xvii
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
F
IGURE
3.9:
Line element 52
F
IGURE
3.10:
Pixels rendered for a Line element 53
F
IGURE
3.11:
Sharp horizontal line drawn with a Rectangle element 54
F
IGURE
3.12:
Example path 55
F
IGURE
3.13:
Path with an empty space in the center 58
F
IGURE
3.14:
Different fills for the same outline 59
F
IGURE

F
IGURE
3.23:
Sample stroke applied to an ellipse 69
F
IGURE
3.24:
The widening process applied to an ellipse 70
F
IGURE
3.25:
The widening process applied to a triangle 71
F
IGURE
3.26:
StrokeDashArray example of long and short dashes 71
F
IGURE
3.27:
RenderTransform example of overlapping a rectangle over
an ellipse 73
F
IGURE
3.28:
3D projection example 75
F
IGURE
3.29:
Position three rectangles in the same 3D projection camera 76
F

Anti-aliasing seam example 87
F
IGURE
3.38:
Pixel snapped rasterization 88
F
IGURE
3.39:
Seams with a rotated edge 89
F
IGURE
3.40:
Image with bilinear filtering 90
F
IGURE
3.41:
Image with nearest neighbor 90
Figures
xviii
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
ptg
Figures xix
F
IGURE
3.42:
The bilinear filtering process 91
F
IGURE
3.43:

IGURE
4.5:
TextBlock formatting example 104
F
IGURE
4.6:
Inherited formatting 104
F
IGURE
4.7:
Text radial gradient example 105
F
IGURE
4.8:
Math formula using Glyphs element 109
F
IGURE
4.9:
Text baseline 110
F
IGURE
5.1:
Hit-test area for a Canvas with a rectangle and circle 125
F
IGURE
6.1:
Frame-based animation 132
F
IGURE
6.2:

IGURE
7.4:
Positioning content explicitly with the Canvas element 158
F
IGURE
7.5:
Surrounding a TextBlock element with a border 160
F
IGURE
7.6:
Adding a rounded rectangle background to a TextBlock element 160
F
IGURE
7.7:
Padding a border element 160
F
IGURE
7.8:
Vertical StackPanel example 161
F
IGURE
7.9:
Horizontal StackPanel example 161
From the Library of Lee Bogdanoff
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status