Pro Silverlight 4 in VB (eBook)

eBook Download: PDF
2011 | 3rd ed.
XXXIII, 896 Seiten
Apress (Verlag)
978-1-4302-3549-1 (ISBN)

Lese- und Medienproben

Pro Silverlight 4 in VB -  Matthew MacDonald
Systemvoraussetzungen
56,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
Silverlight is Microsoft's cross-browser technology for creating rich user experiences on the Web. Like its predecessor, Silverlight 4 rides atop the .NET framework for maximum ease of use and coding efficiency. The technology carries forward much of the work that has been done before and augments it in many important respects, including support for H.264 video, major improvements to the graphics engine (including true 3D rendering), and much richer data-binding options for interfacing with other applications.

Pro Silverlight 4 in VB is an invaluable reference for professional developers who want to discover the features of Silverlight. Author Matthew MacDonald's expert advice guides you through creating rich media applications using Silverlight in the environment you're most productive in-no matter what the target platform. As you learn about the features that put Silverlight in direct competition with Adobe Flash, such as rich support for 2D and 3D drawing, animations, and media playback, you'll experience the plumbing of .NET and the design model of WPF through Silverlight-all of the same .NET technology that developers use to design next-generation Windows applications.

In this book, MacDonald provides a comprehensive tutorial written from professional developer to professional developer.

Matthew MacDonald is an author,educator, and MCSD developer who has a passion for emerging technologies. He isthe author of more than a dozen books about .NET programming. In a dimly-remembered past life, he studied English literature and theoretical physics.


Silverlight is Microsoft's cross-browser technology for creating rich user experiences on the Web. Like its predecessor, Silverlight 4 rides atop the .NET framework for maximum ease of use and coding efficiency. The technology carries forward much of the work that has been done before and augments it in many important respects, including support for H.264 video, major improvements to the graphics engine (including true 3D rendering), and much richer data-binding options for interfacing with other applications. Pro Silverlight 4 in VB is an invaluable reference for professional developers who want to discover the features of Silverlight. Author Matthew MacDonald's expert advice guides you through creating rich media applications using Silverlight in the environment you're most productive in no matter what the target platform. As you learn about the features that put Silverlight in direct competition with Adobe Flash, such as rich support for 2D and 3D drawing, animations, and media playback, you'll experience the plumbing of .NET and the design model of WPF through Silverlight all of the same .NET technology that developers use to design next-generation Windows applications. In this book, MacDonald provides a comprehensive tutorial written from professional developer to professional developer.

Matthew MacDonald is an author,educator, and MCSD developer who has a passion for emerging technologies. He isthe author of more than a dozen books about .NET programming. In a dimly-remembered past life, he studied English literature and theoretical physics.

Cover 1
Title Page 2
Copyright Page 3
Dedication 4
Table of Contents 5
About the Author 22
About the Technical Reviewer 23
Acknowledgments 24
Introduction 25
Understanding Silverlight 25
Silverlight System Requirements 27
Silverlight vs. Flash 27
Silverlight and WPF 29
The Evolution of Silverlight 30
About This Book 31
What You Need to Use This Book 32
The Silverlight Toolkit 32
Code Samples 33
Feedback 33
The Last Word 33
CHAPTER 1 Introducing Silverlight 34
Silverlight Design Tools 34
Visual Studio vs. Expression Blend 34
Understanding Silverlight Websites 35
Creating a Stand-Alone Silverlight Project 36
Creating a Simple Silverlight Page 39
Adding Event-Handling Code 41
Testing a Silverlight Application 43
Creating an ASP.NET-Hosted Silverlight Project 45
ASP.NET Controls That Render Silverlight Content 48
Mixing ASP.NET Controls and Silverlight Content 49
Silverlight Compilation and Deployment 49
Compiling a Silverlight Application 49
Deploying a Silverlight Application 51
Silverlight Core Assemblies 53
Silverlight Add-on Assemblies 54
Assembly Caching 55
The HTML Entry Page 57
Sizing the Silverlight Content Region 59
Silverlight Parameters 59
Alternative Content 61
Creating a Friendly Install Experience 61
The Mark of the Web 63
The Last Word 64
CHAPTER 2 XAML 65
XAML Basics 66
XAML Namespaces 66
Core Silverlight Namespaces 67
Design Namespaces 68
Custom Namespaces 69
The Code-Behind Class 70
Naming Elements 70
Properties and Events in XAML 71
Simple Properties and Type Converters 72
Complex Properties 74
Attached Properties 76
Nesting Elements 77
Events 80
The Full Eight Ball Example 80
XAML Resources 81
The Resources Collection 82
The Hierarchy of Resources 83
Accessing Resources in Code 85
Organizing Resources with Resource Dictionaries 86
Element-to-Element Binding 87
One-Way Binding 87
Two-Way Binding 89
The Last Word 91
CHAPTER 3 Layout 92
The Layout Containers 92
The Panel Background 94
Borders 96
Simple Layout with the StackPanel 97
Layout Properties 99
Alignment 100
Margins 101
Minimum, Maximum, and Explicit Sizes 103
The WrapPanel and DockPanel 105
The WrapPanel 105
The DockPanel 106
The Grid 108
Fine-Tuning Rows and Columns 110
Nesting Layout Containers 111
Spanning Rows and Columns 113
The GridSplitter 114
Coordinate-Based Layout with the Canvas 117
Layering with ZIndex 119
Clipping 119
Custom Layout Containers 121
The Two-Step Layout Process 121
MeasureOverride() 122
ArrangeOverride() 123
The UniformGrid 124
Sizing Pages 129
Scrolling with the ScrollViewer 131
Scaling with the Viewbox 133
Full-Screen Mode 135
The Last Word 137
CHAPTER 4 Dependency Properties and Routed Events 138
Dependency Properties 138
Defining and Registering a Dependency Property 139
Dynamic Value Resolution 141
Attached Properties 142
The WrapBreakPanel Example 143
Routed Events 146
The Core Element Events 146
Event Bubbling 149
Handled (Suppressed) Events 151
An Event Bubbling Example 151
Mouse Handling 154
Right-Clicks 154
Mouse Movements 155
The Mouse Wheel 155
Capturing the Mouse 157
A Mouse Event Example 157
Mouse Cursors 161
Keyboard Handling 162
Key Presses 162
Key Modifiers 164
Focus 165
The Command Model 166
Building a Command 167
Connecting a Command 168
The Last Word 170
CHAPTER 5 Elements 171
The Silverlight Elements 171
Static Text 175
Font Properties 176
Standard Fonts 178
Font Embedding 179
Underlining 180
Runs 181
Wrapping Text 182
Trimming Text 183
Images 183
Image Sizing 184
Image Errors 185
Content Controls 185
The Content Property 187
Aligning Content 189
Buttons 190
The HyperlinkButton 190
The ToggleButton and RepeatButton 191
The CheckBox 191
The RadioButton 192
Tooltips and Pop-Ups 193
Customized Tooltips 193
The Popup 195
Items Controls 197
The ListBox 197
The ComboBox 199
The TabControl 200
Text Controls 201
The TextBox 202
The PasswordBox 204
The AutoCompleteBox 204
Filter Mode 205
Custom Filtering 206
Dynamic Item Lists 208
The RichTextBox 210
Text Elements 211
Formatting Text Elements 213
Manipulating Text Elements in Code 214
Creating a Text Editor 215
Saving and Opening Rich Text Files 217
Using Hyperlinks and Elements in a RichTextBox 219
Range-Based Controls 220
The Slider 221
The ProgressBar 222
Date Controls 222
The Last Word 226
CHAPTER 6 The Application Model 227
The Application Class 227
Accessing the Current Application 228
Application Properties 228
Application Events 229
Application Startup 230
Initialization Parameters 230
Application Shutdown 233
Unhandled Exceptions 233
Custom Splash Screens 236
Binary Resources 240
Placing Resources in the Application Assembly 240
Using Subfolders 242
Programmatically Retrieving a Resource 242
Placing Resources in the Application Package 243
Placing Resources on the Web 244
Failing to Download Resources 245
Downloading Resources with WebClient 246
Class Library Assemblies 248
Using Resources in an Assembly 248
Downloading Assemblies on Demand 249
Supporting Assembly Caching 250
The Strong Key Name 251
The .extmap.xml File 252
The Last Word 254
CHAPTER 7 Navigation 255
Loading User Controls 256
Embedding User Controls in a Page 256
Hiding Elements 258
Managing the Root Visual 258
Retaining Page State 260
Browser History 261
Child Windows 261
Designing a ChildWindow 263
Showing a ChildWindow 264
The Frame and Page 266
Frames 266
Browser URI Integration 269
What Happens If the Page Has More Than One Frame? 270
What Happens If the Startup Page Doesn’t Include a Frame Control? 270
What About Security? 271
History Support 271
Navigation Failure 272
URI Mapping 273
Forward and Backward Navigation 274
Hyperlinks 275
Pages 276
Navigation Properties 276
State Storage 277
Navigation Methods 278
Navigation Templates 279
Custom Content Loaders 280
Authentication and Navigation 281
Creating a Custom Content Loader 282
Using the Custom Content Loader 284
The Last Word 285
CHAPTER 8 Shapes and Geometries 286
Basic Shapes 286
The Shape Classes 287
Rectangle and Ellipse 288
Sizing and Placing Shapes 290
Sizing Shapes Proportionately with a Viewbox 292
Line 294
Polyline 295
Polygon 296
Line Caps and Line Joins 299
Dashes 301
Paths and Geometries 303
Line, Rectangle, and Ellipse Geometries 304
Combining Shapes with GeometryGroup 305
Curves and Lines with PathGeometry 307
Straight Lines 308
Arcs 308
Bézier Curves 310
The Geometry Mini-Language 312
Clipping with Geometry 314
Exporting Clip Art 316
Expression Design 316
Conversion 317
Save or Print to XPS 318
The Last Word 320
CHAPTER 9 Brushes, Transforms, and Bitmaps 321
Brushes 321
The LinearGradientBrush Class 322
The RadialGradientBrush Class 325
The ImageBrush 327
Transparency 328
Opacity Masks 330
Making the Silverlight Control Transparent 332
Transforms 336
Transforming Shapes 338
Transforms and Layout Containers 340
A Reflection Effect 341
Perspective Transforms 342
The PlaneProjection Class 343
Applying a Projection 345
Pixel Shaders 346
BlurEffect 347
DropShadowEffect 347
ShaderEffect 349
The WriteableBitmap Class 350
Generating a Bitmap 350
Capturing Content from Other Elements 353
Printing 354
Printing a Single Element 355
Printing Over Multiple Pages 357
Creating a Print Preview 360
The Last Word 362
CHAPTER 10 Animation 363
Understanding Silverlight Animation 363
The Rules of Animation 364
Creating Simple Animations 365
The Animation Class 365
The Storyboard Class 366
Starting an Animation with an Event Trigger 367
Starting an Animation with Code 367
Configuring Animation Properties 368
From 369
To 370
By 370
Duration 371
Animation Lifetime 371
RepeatBehavior 372
Simultaneous Animations 373
Controlling Playback 374
Animation Easing 376
Using an Easing Function 377
Easing In and Easing Out 378
Easing Function Classes 379
Animation Types Revisited 382
Animating Transforms 382
Animation Perspective Projections 385
Animating Brushes 386
Animating Pixel Shaders 388
Key-Frame Animation 389
Discrete Key Frames 390
Easing Key Frames 391
Spline Key Frames 392
Animations in Code 393
The Main Page 394
The Bomb User Control 396
Dropping the Bombs 397
Intercepting a Bomb 400
Counting Bombs and Cleaning Up 402
Encapsulating Animations 404
Page Transitions 404
The Base Class 405
The Wipe Transition 406
Frame-Based Animation 408
Animation Performance 412
Desired Frame Rate 412
Hardware Acceleration 413
Enabling Hardware Acceleration 414
Bitmap Caching 414
Evaluating Hardware Acceleration 417
The Last Word 418
CHAPTER 11 Sound, Video, and Deep Zoom 419
Supported File Types 419
The MediaElement 420
Controlling Playback 421
Handling Errors 422
Playing Multiple Sounds 422
Changing Volume, Balance, and Position 423
Playing Video 427
Client-Side Playlists 427
Server-Side Playlists 428
Progressive Downloading and Streaming 428
Adaptive Streaming 430
Advanced Video Playback 431
Video Encoding 431
Encoding in Expression Encoder 432
Markers 434
Adding Markers with Expression Encoder 435
Using Markers in a Silverlight Application 436
VideoBrush 439
Video Effects 440
Webcam and Microphone Input 446
Accessing a Capture Device 446
Basic Webcam Support 448
Recording Audio Snippets 451
Deep Zoom 455
Creating a Deep Zoom Image Set 457
Using a Deep Zoom Image Set in Silverlight 461
The Last Word 465
CHAPTER 12 Styles and Behaviors 466
Styles 466
Defining a Style 467
Applying a Style 468
Dynamic Styles 469
Style Inheritance 469
Organizing Styles 471
Automatically Applying Styles by Type 471
Behaviors 472
Getting Support for Behaviors 473
Triggers and Actions 474
Creating an Action 474
Connecting an Action to an Element 476
Design-Time Behavior Support in Blend 477
Creating a Targeted Trigger 480
Creating a Behavior 484
Finding More Behaviors 487
The Last Word 489
CHAPTER 13 Templates and Custom Controls 490
Template Basics 490
Creating a Template 491
Reusing Control Templates 492
The ContentPresenter 493
Template Bindings 494
Setting Templates Through Styles 495
Reusing Colors 497
The Parts and States Model 497
Understanding States with the Button Control 499
Showing a Focus Cue 503
Transitions 504
The Default Transition 505
From and to Transitions 506
Transitioning to a Steady State 507
Custom Transition 507
Understanding Parts with the Slider Control 509
Creating Templates for Custom Controls 513
Planning the FlipPanel Control 514
Creating the Solution 514
Starting the FlipPanel Class 515
Adding the Default Style with Generic.xaml 516
Choosing Parts and States 518
Starting the Default Control Template 520
The FlipButton Control 521
Defining the State Animations 522
Wiring Up the Elements in the Template 524
Using the FlipPanel 526
Using a Different Control Template 527
The Last Word 529
CHAPTER 14 Browser Integration 530
Interacting with HTML Elements 531
Getting Browser Information 532
The HTML Window 533
Popup Windows 534
Inspecting the HTML Document 535
Manipulating an HTML Element 537
Inserting and Removing Elements 540
Changing Style Properties 541
Handling JavaScript Events 542
Code Interaction 544
Calling Browser Script from Silverlight 545
Calling Silverlight Methods from the Browser 545
Instantiating Silverlight Objects in the Browser 547
Combining Silverlight and HTML Content 549
Sizing the Silverlight Control to Fit Its Content 549
Placing the Silverlight Control Next to an HTML Element 550
Securing HTML Interoperability 553
The Last Word 554
CHAPTER 15 ASP.NET Web Services 555
Building Web Services for Silverlight 555
Creating a Web Service 555
Adding a Service Reference 557
Calling the Web Service 559
Configuring the Web Service URL 562
Using a Busy Indicator 563
Web Service Data Types 565
Custom Data Classes 565
Web Service Type Sharing 566
Identifying Your Data Classes 567
Sharing the Code 568
More Advanced Web Services 571
Cross-Domain Web Service Calls 572
Monitoring the Network Connection 574
Using ASP.NET Platform Services 575
Duplex Services 577
Configuring the Service 577
The Interfaces 578
The Service 580
The Client 581
The Last Word 583
CHAPTER 16 Data Binding 584
Binding to Data Objects 584
Building a Data Object 585
Displaying a Data Object with DataContext 586
Storing a Data Object as a Resource 588
Null Values and Failed Bindings 589
Editing with Two-Way Bindings 589
Change Notification 591
Building a Data Service 592
Calling a Data Service 596
Binding to a Collection of Objects 597
Displaying and Editing Collection Items 598
Inserting and Removing Collection Items 601
Binding to a LINQ Expression 602
Master-Details Display 604
Validation 608
Error Notifications 608
The BindingValidationFailed Event 611
The Validation Class 612
Creating Data Objects with Built-in Validation 613
Data Formatting and Conversion 617
String Formatting 617
Value Converters 619
Formatting Strings with a Value Converter 620
Creating Objects with a Value Converter 622
Applying Conditional Formatting 624
Data Templates 627
Separating and Reusing Templates 629
More Advanced Templates 629
Changing Item Layout 631
The Last Word 632
CHAPTER 17 Data Controls 633
Better Data Forms 634
The Goal: Data Class Markup 634
The Label 635
The DescriptionViewer 637
The ValidationSummary 639
Data Annotations 641
Raising Annotation Errors 642
The Annotation Attributes 643
Required 644
StringLength 644
Range 644
RegularExpression 645
CustomValidation 647
The DataGrid 649
Creating a Simple Grid 650
How Columns Are Resized and Rearranged 652
Defining Columns 653
The DataGridCheckBoxColumn 655
The DataGridTemplateColumn 655
Formatting and Styling Columns 656
Controlling Column Width 658
Formatting Rows 660
Row Details 662
Freezing Columns 663
Selection 664
Sorting 665
DataGrid Editing 666
Editing with Templates 666
Validation and Editing Events 667
The PagedCollectionView 670
Sorting 671
Filtering 671
Grouping 672
Paging 674
The TreeView 677
Filling a TreeView 677
A Data-Bound TreeView 677
The Last Word 680
CHAPTER 18 File Access 681
Isolated Storage 682
The Scope of Isolated Storage 682
What to Put in Isolated Storage 683
Using Isolated Storage 683
Opening an Isolated Store 683
File Management 684
Writing and Reading Data 685
Requesting More Space 687
Storing Objects with XmlSerializer 689
Storing Application Settings 692
Accessing Files Outside of Isolated Storage 693
Reading Files with OpenFileDialog 694
Writing Files with SaveFileDialog 696
Transmitting Files with a Web Service 696
The File Service 697
The Silverlight Client 699
Dragging and Dropping Files 702
The Last Word 705
CHAPTER 19 Multithreading 706
Understanding Multithreading 706
The Goals of Multithreading 707
The DispatcherTimer 708
The Thread Class 708
Marshaling Code to the User Interface Thread 710
Creating a Thread Wrapper 712
Creating the Worker Class 714
Using the Thread Wrapper 715
Cancellation Support 717
The BackgroundWorker 719
Creating the BackgroundWorker 719
Running the BackgroundWorker 720
Tracking Progress 723
Supporting Cancellation 725
The Last Word 727
CHAPTER 20 Networking 728
Interacting with the Web 729
Cross-Domain Access 729
HTML Scraping 731
REST and Other Simple Web Services 735
Using Network Credentials 740
Processing Different Types of Data 740
XML 740
Services That Return XML Data 741
Navigating Over an XDocument 744
Querying an XDocument with LINQ 746
Services That Require XML Data 748
Services That Return SOAP Data 750
Services That Return JSON Data 751
RSS 754
Sockets 756
Understanding Sockets and TCP 757
The Policy Server 759
The Policy File 760
The PolicyServer Classes 760
The PolicyConnection Classes 762
The Messaging Server 763
The Messenger Client 767
Connecting to the Server 767
Sending Messages 770
Receiving Messages 771
Local Connections 772
Sending a Message 773
Receiving a Message 774
The Last Word 775
CHAPTER 21 Out-of-Browser Applications 776
Understanding Out-of-Browser Support 777
Creating an Out-of-Browser Application 778
Installing an Out-of-Browser Application 780
Customizing Icons 783
Tracking Application State 784
Removing and Updating an Application 787
Silent Installation 789
Out-of-Browser Application Features 789
The WebBrowser Control 790
Showing HTML Content 791
The WebBrowserBrush 792
Interacting with JavaScript Code 793
Notification Windows 793
Controlling the Main Window 796
Elevated Trust 798
Installing an Elevated Trust Application 798
The Abilities of an Elevated Trust Application 801
Window Customization 802
File Access 809
COM 811
The Last Word 815
Index 816

Erscheint lt. Verlag 26.9.2011
Zusatzinfo XXXIII, 896 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Software Entwicklung
Schlagworte Animation • Control • Navigation • Technology • Video • Web Services
ISBN-10 1-4302-3549-7 / 1430235497
ISBN-13 978-1-4302-3549-1 / 9781430235491
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 16,2 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Das umfassende Handbuch

von Jürgen Sieben

eBook Download (2023)
Rheinwerk Computing (Verlag)
89,90
Eine kompakte Einführung

von Brendan Burns; Joe Beda; Kelsey Hightower; Lachlan Evenson

eBook Download (2023)
dpunkt (Verlag)
39,90