Introducing Silverlight 4 (Expert's Voice in Silverlight) [1 ed.] 1430229918, 9781430229919, 9781430229926

I have read many technical books over the years and this is one is one of those books that you know you better keep hand

269 4 7MB

English Pages 745 Year 2010

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Prelim......Page 1
Contents......Page 6
About the Author......Page 19
About the Technical Reviewer......Page 20
Acknowledgments......Page 21
Introduction......Page 22
Introduction to Silverlight......Page 25
Introducing Silverlight......Page 27
The Java Platform......Page 28
Microsoft Silverlight......Page 29
Silverlight 1......Page 30
Silverlight 2......Page 31
Silverlight 3......Page 33
Silverlight 4......Page 35
Visual Studio......Page 38
SketchFlow......Page 39
Creating a Silverlight 4–based Application......Page 40
Working with Expression Blend......Page 43
Demonstrating Local Image Files Integration Using Drag-andDrop Functionality......Page 45
Summary......Page 50
Silverlight Architecture......Page 51
Developing a Sample Application......Page 53
Defining User Interface Using Code-Behind......Page 54
The XAML Controls Structure......Page 56
Namespaces......Page 57
Dependency Property System......Page 58
Dependency Properties......Page 59
Type Converters......Page 63
Resource Dictionaries, Referencing Static Resources, and Implicit Styling......Page 64
Data Binding......Page 68
Template Binding......Page 71
Core .NET Assemblies for Silverlight Applications......Page 72
Managed Code-Behind .NET Integration......Page 73
Summary......Page 80
Building Blocks......Page 81
DependencyObject......Page 82
UIElement......Page 83
FrameworkElement......Page 87
The Control Class......Page 90
Enhancements in Silverlight 4......Page 92
Canvas......Page 93
StackPanel......Page 94
Grid......Page 95
DockPanel......Page 98
WrapPanel......Page 101
TabControl......Page 102
ViewBox......Page 104
The Button Controls......Page 105
RepeatButton......Page 107
Toggle Buttons: CheckBox and RadioButton......Page 108
TextBox......Page 109
PasswordBox......Page 111
RichTextBox......Page 112
AutoCompleteBox......Page 115
Data Integration and Data Manipulation Controls......Page 119
ListBox......Page 120
ComboBox......Page 122
TreeView......Page 123
The TreeViewItem Class......Page 125
HeaderedItemsControl......Page 126
HeaderedContentControl......Page 127
DataForm......Page 128
DescriptionViewer......Page 129
Border......Page 130
GridSplitter......Page 131
TextBlock......Page 133
Popup......Page 135
ToolTipService......Page 136
ScrollViewer......Page 137
ScrollBar......Page 139
Slider......Page 140
ProgressBar......Page 141
Calendar and DatePicker......Page 142
MultiScaleImage......Page 145
Strokes and StylePoints......Page 146
Dialog Boxes......Page 148
OpenFileDialog......Page 149
SaveFileDialog......Page 151
ChildWindow......Page 154
WebBrowser......Page 157
The Frame Class......Page 158
The Page Class......Page 160
Summary......Page 161
Content Integration in Silverlight Applications......Page 163
Media Integration Enhancements in Silverlight 4......Page 165
The Image Class......Page 166
Bitmap APIs......Page 171
Silverlight Hardware Acceleration......Page 176
Bitmap Caching......Page 177
Cache and Frame Rate Counter Visualization......Page 178
Multi-scale Images and the Deep Zoom Feature......Page 179
Developing an Example Using Deep Zoom Composer......Page 182
Media (Video and Audio)......Page 186
Supported Media Format......Page 187
The MediaElement Class......Page 188
Timeline Markers......Page 196
The CaptureDeviceConfiguration Class......Page 198
The CaptureDevice, AudioCaptureDevice, and VideoCaptureDevice Classes......Page 200
The CaptureSource Class......Page 201
Developing an Example......Page 203
Publishing Silverlight Applications Video Content......Page 207
Summary......Page 208
Enabling Cross-Domain Communication......Page 209
Cross-Domain Policy Files......Page 210
The clientaccesspolicy.xml File......Page 211
Trusted Applications......Page 213
Consuming Web Services with WCF......Page 215
Creating a WCF Service Consumable by Silverlight......Page 216
XAML to Consume Information......Page 219
Invoking Services from Silverlight......Page 220
Silverlight Service Utility Tool......Page 221
Asynchronous Communication......Page 223
Handling Errors......Page 226
The WebClient Class......Page 231
The HttpWebRequest Class......Page 235
Controlling Client Access via a Socket Policy Server......Page 237
The Socket Class......Page 238
The SocketAsyncEventArgs Class......Page 240
Building a Socket-Based Sample Text Chat Application......Page 241
The PolicyServer Windows Service Project......Page 242
The MessengerServer Windows Service Project......Page 247
The MainPage.xaml File......Page 252
The MainPage.xaml.cs Code-Behind File......Page 253
Executing the Text Chat Application......Page 254
The UdpAnySourceMulticastClient Class......Page 256
The UdpSingleSourceMulticastClient Class......Page 258
Summary......Page 260
Enhancements in Silverlight 4......Page 261
Data Binding......Page 262
Enabling Data Change Notification......Page 267
Rich Data Binding Support in Visual Studio 2010......Page 269
Data Validation......Page 270
IDataErrorInfo Interface for Client-Side Validation......Page 273
INotifyDataErrorInfo Interface for Asynchronous Server-Side Validation......Page 275
XAML Element Data Binding / Element-to-Element Binding......Page 284
DependencyObject Binding......Page 285
Type Converters......Page 286
StringFormat......Page 287
BindingBase.FallbackValue and BindingBase.TargetNullValue Properties......Page 288
Binding to String Indexers......Page 289
The DataGrid Control......Page 290
Implementing Grouping, Sorting, Filtering, and Paging......Page 291
DataGrid Editing Events......Page 297
DataGrid Column Sizing......Page 298
Clipboard Support......Page 300
Row-Level Data Validation......Page 301
The DataForm Control......Page 303
Customized Display of DataForm Fields......Page 306
Field-Level Validation......Page 307
WCF Data Services......Page 308
Entity Data Model (EDM)......Page 309
The DataServiceContext Class......Page 310
The DataServiceQuery Class......Page 312
Silverlight Application using WCF Data Service......Page 313
Create ADO .NET Entity Data Model......Page 314
Create WCF Data Service......Page 315
Create WCF Data Services Proxy and Retrieve the Records......Page 318
Two-Way Binding with DataServiceCollection Class......Page 320
Handling Deferred Content......Page 321
Processing XML Data......Page 323
Parsing XML......Page 324
Serializing XML......Page 325
Using LINQ......Page 326
Saving State on the Client......Page 327
Summary......Page 333
Improving User Experience......Page 335
Enhancements in Silverlight 4......Page 337
Events of UIElement to Enable Drag-and-Drop Functionality......Page 338
Defining User Control......Page 339
Implementing Code-Behind of the User Control......Page 341
Adding ChildWindow as an Image Viewer......Page 345
Developing an Example......Page 348
Right-Click Context Menu Support......Page 350
Printing Capabilities......Page 353
PrintPageEventArgs Class......Page 354
Printing the Application Screen......Page 355
Printing Selected Control......Page 357
Custom Printing......Page 358
Clipboard Access......Page 360
Globalization......Page 362
CultureInfo Class......Page 363
Developing an Example......Page 364
Hub-and-Spoke Model......Page 366
Implementing an Example......Page 368
Flexible Root XAML Namespace......Page 376
Whitespace Handling......Page 377
Summary......Page 378
Using Styles......Page 379
Style Inheritance/Style Cascading......Page 384
Style Override/Style Resetting......Page 385
Merged Resource Dictionaries......Page 387
Implicit Styling......Page 388
Style Setter......Page 389
Creating a Control Template......Page 390
Visual State Manager (VSM)......Page 392
Custom Button Control using Control Template......Page 398
Control Templates for Other Controls......Page 401
Developing a Templated Control......Page 402
Summary......Page 405
2D Graphics......Page 407
Simple Geometries......Page 408
Path Geometries......Page 411
Clipping with Geometries......Page 414
Using Shapes......Page 415
Ellipse......Page 416
Path......Page 417
Transforms......Page 419
Rotation......Page 420
Skewing......Page 421
Scaling......Page 422
Arbitrary Linear Transforms......Page 423
Composite Transformation......Page 425
3D Effects Using Perspective Transforms......Page 427
Pixel Shaders......Page 429
Brushes......Page 431
The Tile Brushes......Page 432
The Video Brush......Page 433
The Gradient Brushes......Page 434
The LinearGradientBrush......Page 435
Transparency and Opacity Masks......Page 436
Summary......Page 438
Introduction to Silverlight Animation......Page 439
Timelines......Page 440
AutoReverse......Page 442
BeginTime......Page 443
Duration......Page 444
SpeedRatio......Page 445
From/To/By Animations......Page 447
Foreground Animation: An Example......Page 448
Shimmering Effect for Background Animation: An Example......Page 454
Keyframe Animations......Page 455
Interpolation......Page 457
Animation Easing......Page 461
Understanding Animation-Easing Functions......Page 463
Bubble User Control......Page 465
DemoPage User Control......Page 467
Animating with Expression Blend......Page 471
3D Animation......Page 475
Summary......Page 476
Advanced Topics......Page 477
Silverlight Navigation Framework......Page 479
The Frame Class......Page 481
Start-Up Page and Application Navigation Features......Page 483
Navigation History and Integration with Browser......Page 486
The INavigationContentLoader Interface......Page 487
Extending the Example......Page 489
Search Engine Optimization......Page 495
Out-of-Browser Functionality......Page 498
Enabling the Out-of-Browser Functionality......Page 499
In-Browser Install: Default Option......Page 501
In-Browser Install: Custom Developed Option......Page 502
Silent Install......Page 503
The Silent Uninstall Option......Page 504
Trusted Out-of-Browser Applications......Page 505
Custom Icons......Page 506
Window Manipulation and Customization......Page 507
Working with the Networking and Offline APIs......Page 508
Incorporating an Updated Version......Page 512
Files Management......Page 514
Notification API......Page 518
COM Automation......Page 521
Commanding Support......Page 526
The ViewModel Class......Page 528
The View.xaml File......Page 529
Cross-Silverlight Application Communication......Page 530
Using the System.Windows.Messaging Namespace......Page 531
Seeing an Example in Action......Page 532
Creating the Sender Silverlight Application......Page 533
Creating the Receiver Silverlight Application......Page 534
Hosting the Sender and Receiver Applications on the Same Page......Page 536
Summary......Page 538
Using Threading......Page 539
The Thread Class......Page 540
Creating and Managing Threads......Page 543
The Dispatcher......Page 545
The BackgroundWorker Class......Page 546
Working with Shared Data......Page 550
Using Timers......Page 553
Using the DispatcherTimer......Page 554
Using the System.Threading Timer......Page 555
Summary......Page 556
WCF RIA Services for Silverlight......Page 557
Setting Up a Development Environment......Page 558
Introducing Silverlight Business Application Template......Page 559
Running the Default Project......Page 561
Implementing Windows Authentication......Page 564
ADO .NET Entity Data Model for Data Integration......Page 565
Domain Service Class for Data Integration......Page 566
Reading and Displaying Data from the Data Source......Page 567
Additional References......Page 569
Developing a Sample Twitter Application......Page 570
Defining the User Interface......Page 571
Code-Behind for Twitter Integration......Page 574
Testing Silverlight Windows Mobile Application Using Windows Phone 7 Emulator......Page 575
Summary......Page 577
Dynamic Languages......Page 579
Dynamic Languages for Silverlight......Page 580
Dynamic Language Runtime (DLR) for Silverlight......Page 581
DLR Scripting Assemblies......Page 582
The Microsoft.Scripting.Silverlight.DynamicApplication Class......Page 583
The Traditional Approach with the Chiron.exe File......Page 584
The “Just-Text” Approach......Page 585
In-Line IronRuby/IronPython Code in Hosting HTML File......Page 588
Externalizing XAML and IronRuby/IronPython Code......Page 589
Include Bing Maps Control to the Solution......Page 590
Include Bing Maps Control As an External ZIP File......Page 591
Creating a SilverlightMap.html File......Page 592
Adding 3D Animation within the SilverlightMap.xaml File......Page 593
Creating a SilverlightMap.rb IronRuby File and Adding Map Mode......Page 594
Add Rotate Map Capabilities......Page 595
Targeting Pre-defined Locations......Page 599
Summary......Page 601
.NET Security in the CLR......Page 603
Silverlight Security Model......Page 604
Configuring Silverlight 4 Applications to Run with Elevated Trust......Page 606
Digitally Signing Out-of-Browser Silverlight Applications......Page 609
Elevated-Trusted Silverlight Applications vs. Partially Trusted Silverlight Applications......Page 611
Securing Information with Cryptography......Page 613
Hash Algorithms and Message Authentication Codes......Page 614
Encrypting/Decrypting Data......Page 616
User Access Control......Page 620
Same-Domain and Cross-Domain Communication......Page 631
Division of Responsibility......Page 633
Summary......Page 636
Testing and Deploying Silverlight RIAs......Page 637
Testing......Page 639
Silverlight Unit Testing Framework......Page 640
Automated User Interface Testing......Page 651
UI Spy Tool......Page 652
Implementing UI Automation Testing......Page 653
The Debugging Process......Page 657
Conditional Compilation......Page 658
Debugging Silverlight Applications with Visual Studio......Page 659
Controlling the Debugger......Page 660
Configuring Startup for Debugging......Page 661
Handling Unhandled Exceptions......Page 664
Summary......Page 668
Client Considerations......Page 669
Disabling Silverlight Plug-In Using Web Browser......Page 670
Silverlight Configuration......Page 671
Silverlight Deployment Package Definition......Page 674
Silverlight Application Package (XAP File)......Page 675
Application Manifest File......Page 677
Application Startup Assembly File......Page 678
In-Package and On-Demand Files......Page 680
Copy Local Property......Page 681
Build Action Property......Page 682
Hosting Silverlight Applications......Page 683
Server-Side Silverlight RIA Deployment......Page 685
Custom Initialization Parameters......Page 686
HTML object Element......Page 687
Silverlight.js JavaScript Helper File......Page 690
Silverlight and the Build Process......Page 691
Building a Silverlight Application Visual Studio Project (.csproj) with MSBuild......Page 692
Building a Silverlight Application MsBuild Project (.proj) with MSBuild......Page 694
Silent Installer for Silverlight Out-of-Browser Applications......Page 697
Summary......Page 698
Index......Page 699

Introducing Silverlight 4 (Expert's Voice in Silverlight) [1 ed.]
 1430229918, 9781430229919, 9781430229926

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up