Pro Silverlight 3 in VB - Matthew MacDonald

Pro Silverlight 3 in VB (eBook)

eBook Download: PDF
2010 | 1st ed.
640 Seiten
Apress (Verlag)
978-1-4302-2428-0 (ISBN)
Systemvoraussetzungen
46,00 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Silverlight is a lightweight browser plug-in that frees your code from the traditional confines of the browser. It's a rules-changing, groundbreaking technology that allows you to run rich client applications right inside the browser. Even more impressively, it's able to host true .NET applications in non-Microsoft browsers (like Firefox) and on non-Microsoft platforms (like Mac OS X). Silverlight is still new and evolving fast, and you need a reliable guidebook to make sense of it.

Pro Silverlight 3 in VB, Second Edition is the perfect reference to ensure you are informed and up to date: you'll learn about the features that put Silverlight in direct competition with Adobe Flash, such as rich support for 2D drawing, animations, and media playback, and best of all, 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. Author Matthew MacDonald provides an expertly crafted tutorial written from professional developer to professional developer. You'll learn to create rich media applications using Silverlight in the environment you're most productive in-no matter what the target platform.



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 a lightweight browser plug-in that frees your code from the traditional confines of the browser. It's a rules-changing, groundbreaking technology that allows you to run rich client applications right inside the browser. Even more impressively, it's able to host true .NET applications in non-Microsoft browsers (like Firefox) and on non-Microsoft platforms (like Mac OS X). Silverlight is still new and evolving fast, and you need a reliable guidebook to make sense of it.Pro Silverlight 3 in VB, Second Edition is the perfect reference to ensure you are informed and up to date: you'll learn about the features that put Silverlight in direct competition with Adobe Flash, such as rich support for 2D drawing, animations, and media playback, and best of all, 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. Author Matthew MacDonald provides an expertly crafted tutorial written from professional developer to professional developer. You'll learn to create rich media applications using Silverlight in the environment you’re most productive in—no matter what the target platform.

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.

Contents at a Glance 5
Table of Contents 6
About the Author 22
About the Technical Reviewer 23
Acknowledgments 24
Introduction 25
Understanding Silverlight 25
About This Book 32
The Last Word 34
CHAPTER 1 Introducing Silverlight 35
Silverlight Design Tools 35
Visual Studio vs. Expression Blend 36
Understanding Silverlight Websites 37
Creating a Stand-Alone Silverlight Project 38
Creating a Simple Silverlight Page 41
Adding Event Handling Code 43
Testing a Silverlight Application 45
Creating an ASP.NET-Hosted Silverlight Project 46
ASP.NET Controls That Render Silverlight Content 50
Mixing ASP.NET Controls and Silverlight Content 51
Silverlight Compilation and Deployment 51
Compiling a Silverlight Application 51
Deploying a Silverlight Application 53
Silverlight Core Assemblies 55
Silverlight Add-On Assemblies 56
Assembly Caching 56
The HTML Entry Page 58
Sizing the Silverlight Content Region 60
Silverlight Parameters 60
Alternative Content 62
Creating a Friendly Install Experience 62
The Mark of the Web 63
The Last Word 65
CHAPTER 2 XAML 66
XAML Basics 67
XAML Namespaces 67
Core Silverlight Namespaces 68
Design Namespaces 69
Custom Namespaces 70
The Code-Behind Class 71
Naming Elements 72
Properties and Events in XAML 72
Simple Properties and Type Converters 74
Complex Properties 75
Attached Properties 77
Nesting Elements 78
Events 81
The Full Eight Ball Example 82
XAML Resources 83
The Resources Collection 83
The Hierarchy of Resources 85
Accessing Resources in Code 86
Organizing Resources with Resource Dictionaries 87
Element-to-Element Binding 89
One-Way Binding 89
Two-Way Binding 91
The Last Word 92
CHAPTER 3 Layout 93
The Layout Containers 93
The Panel Background 95
Borders 97
Simple Layout with the StackPanel 98
Layout Properties 100
Alignment 101
Margins 102
Minimum, Maximum, and Explicit Sizes 104
The WrapPanel and DockPanel 106
The WrapPanel 107
The DockPanel 108
The Grid 110
Fine-Tuning Rows and Columns 112
Nesting Layout Containers 113
Spanning Rows and Columns 115
The GridSplitter 116
Coordinate-Based Layout with the Canvas 119
Layering with ZIndex 121
Clipping 121
Custom Layout Containers 123
The Two-Step Layout Process 123
MeasureOverride() 123
ArrangeOverride() 125
The UniformGrid 126
Sizing Pages 131
Scrolling 133
Scaling 135
Full Screen 137
The Last Word 138
CHAPTER 4 Dependency Properties and Routed Events 140
Dependency Properties 140
Defining and Registering a Dependency Property 141
Dynamic Value Resolution 143
Attached Properties 144
The WrapBreakPanel Example 145
Routed Events 148
The Core Element Events 148
Event Bubbling 151
Handled (Suppressed) Events 152
An Event Bubbling Example 153
Mouse Movements 156
The Mouse Wheel 156
Capturing the Mouse 158
A Mouse Event Example 159
Mouse Cursors 162
Key Presses 163
Key Modifiers 165
Focus 166
The Last Word 166
CHAPTER 5 Elements 168
The Silverlight Elements 168
Static Text 172
Font Properties 174
Standard Fonts 175
Font Embedding 176
Underlining 177
Runs 178
Wrapping Text 179
Images 179
Image Sizing 180
Image Errors 181
Content Controls 182
The Content Property 183
Aligning Content 185
Buttons 186
The HyperlinkButton 186
The ToggleButton and RepeatButton 187
The CheckBox 188
The RadioButton 188
Tooltips and Pop-Ups 189
Customized ToolTips 190
The Popup 192
Items Controls 193
The ListBox 193
The ComboBox 196
The TabControl 196
Text Controls 198
Text Selection 199
The PasswordBox 199
The AutoCompleteBox 200
Filter Mode 201
Custom Filtering 202
Dynamic Item Lists 204
Range-Based Controls 206
The Slider 207
The ProgressBar 208
Date Controls 208
The Last Word 211
CHAPTER 6 The Application Model 213
The Application Class 213
Accessing the Current Application 214
Application Properties 214
Application Events 215
Application Startup 216
Initialization Parameters 217
Application Shutdown 220
Unhandled Exceptions 220
Custom Splash Screens 222
Out-of-Browser Applications 227
Enabling Out-of-Browser Support 229
Installing an Out-of-Browser Application 231
Customizing Icons 233
Tracking Application State 234
Removing and Updating an Application 237
Binary Resources 239
Placing Resources in the Application Assembly 240
Programmatically Retrieving a Resource 242
Using Subfolders 241
Placing Resources in the Application Package 242
Placing Resources on the Web 243
Failing to Download Resources 245
Downloading Resources with WebClient 245
Class Library AssembliesSo far, 247
Using Resources in an Assembly 247
Downloading Assemblies on Demand 248
Supporting Assembly Caching 249
The Strong Key Name 250
The .extmap.xml File 251
The Last Word 253
CHAPTER 7 Navigation 254
Loading User Controls 254
Embedding User Controls in a Page 255
Hiding Elements 257
Managing the Root Visual 257
Retaining Page State 259
Browser History 260
Child Windows 260
Designing a ChildWindow 262
Showing a ChildWindow 263
The Frame and Page 265
Frames 265
Browser URI Integration 268
History Support 270
URI Mapping 271
Forward and Backward Navigation 273
Hyperlinks 274
Pages 274
Navigation Properties 275
State Storage 276
Navigation Methods 276
Navigation Templates 277
The Last Word 278
CHAPTER 8 Shapes and Geometries 279
Basic Shapes 279
The Shape Classes 280
Rectangle and Ellipse 281
Sizing and Placing Shapes 283
Sizing Shapes Proportionately with a Viewbox 286
Line 288
Polyline 289
Polygon 290
Line Caps and Line Joins 293
Dashes 295
Paths and Geometries 297
Line, Rectangle, and Ellipse Geometries 298
Combining Shapes with GeometryGroup 299
Curves and Lines with PathGeometry 301
Straight Lines 302
Arcs 303
Bézier Curves 305
The Geometry Mini-Language 307
Clipping with Geometry 309
Exporting Clip Art 310
Expression Design 310
Conversion 312
Save or Print to XPS 312
The Last Word 315
CHAPTER 9 Brushes, Transforms, and Bitmaps 316
Brushes 316
The LinearGradientBrush Class 317
The RadialGradientBrush Class 320
The ImageBrush 322
Transparency 323
Opacity Masks 326
Making the Silverlight Control Transparent 327
Transforms 330
Transforming Shapes 332
Transforms and Layout Containers 334
A Reflection Effect 335
Perspective Transforms 337
The PlaneProjection Class 338
Applying a Projection 340
Pixel Shaders 341
BlurEffect 342
DropShadowEffect 342
ShaderEffect 344
The WriteableBitmap Class 345
Generating a Bitmap 345
Capturing Content from Other Elements 347
The Last Word 348
CHAPTER 10 Animation 349
Understanding Silverlight Animation 349
The Rules of Animation 350
Creating Simple Animations 351
The Animation Class 352
The Storyboard Class 352
Starting an Animation with an Event Trigger 353
Starting an Animation with Code 354
Configuring Animation Properties 355
From 355
To 356
By 357
Duration 357
Animation Lifetime 357
RepeatBehavior 359
Simultaneous Animations 360
Controlling Playback 360
Animation Easing 363
Using an Easing Function 363
Easing In and Easing Out 364
Easing Function Classes 366
Animation Types Revisited 369
Animating Transforms 369
Animation Perspective Projections 372
Animating Brushes 374
Animating Pixel Shaders 375
Key-Frame Animation 377
Discrete Key Frames 378
Easing Key Frames 379
Spline Key Frames 379
Animations in Code 381
The Main Page 382
The Bomb User Control 383
Dropping the Bombs 385
Intercepting a Bomb 388
Counting Bombs and Cleaning Up 389
Encapsulating Animations 391
Page Transitions 392
The Base Class 393
The Wipe Transition 394
Frame-Based Animation 396
Animation Performance 400
Desired Frame Rate 400
Hardware Acceleration 401
Enabling Hardware Acceleration 402
Bitmap Caching 402
Evaluating Hardware Acceleration 405
The Last Word 407
CHAPTER 11 Sound, Video, and Deep Zoom 408
Supported File Types 408
The MediaElement 409
Controlling Playback 410
Handling Errors 411
Playing Multiple Sounds 411
Changing Volume, Balance, and Position 412
Playing Video 416
Client-Side Playlists 416
Server-Side Playlists 417
Progressive Downloading and Streaming 417
Adaptive Streaming 420
Advanced Video Playback 420
Video Encoding 421
Encoding in Expression Encoder 422
Markers 424
Adding Markers with Expression Encoder 424
Using Markers in a Silverlight Application 426
VideoBrush 429
Video Effects 430
Deep Zoom 436
Creating a Deep Zoom Image Set 438
Using a Deep Zoom Image Set in Silverlight 442
The Last Word 446
CHAPTER 12 Styles and Behaviors 447
Styles 447
Defining a Style 448
Applying a Style 449
Dynamic Styles 450
Style Inheritance 451
Organizing Styles 452
Behaviors 453
Getting Support for Behaviors 454
Triggers and Actions 454
Creating an Action 455
Connecting an Action to an Element 457
Design-Time Behavior Support in Blend 458
Creating a Targeted Trigger 461
Creating a Behavior 465
Finding More Behaviors 468
The Last Word 470
CHAPTER 13 Templates and Custom Controls 471
Template Basics 471
Creating a Template 472
Reusing Control Templates 473
The ContentPresenter 474
Template Bindings 475
Setting Templates through Styles 476
Reusing Colors 478
The Parts and States Model 478
Understanding States with the Button Control 480
Showing a Focus Cue 484
Transitions 485
The Default Transition 486
From and To Transitions 487
Transitioning to a Steady State 488
Custom Transition 488
Understanding Parts with the Slider Control 490
Creating Templates for Custom Controls 494
Planning the FlipPanel Control 495
Creating the Solution 496
Starting the FlipPanel Class 496
Adding the Default Style with Generic.xaml 498
Choosing Parts and States 500
Starting the Default Control Template 502
The FlipButton Control 503
Defining the State Animations 504
Wiring Up the Elements in the Template 506
Using the FlipPanel 508
Using a Different Control Template 509
The Last Word 511
CHAPTER 14 Browser Integration 512
Interacting with HTML Elements 513
Getting Browser Information 514
The HTML Window 515
Popup Windows 516
Inspecting the HTML Document 517
Manipulating an HTML Element 519
Inserting and Removing Elements 522
Changing Style Properties 523
Handling JavaScript Events 524
Code Interaction 526
Calling Browser Script from Silverlight 526
Calling Silverlight Methods from the Browser 526
Instantiating Silverlight Objects in the Browser 529
Combining Silverlight and HTML Content 530
Sizing the Silverlight Control to Fit Its Content 531
Placing the Silverlight Control Next to an HTML Element 532
Securing HTML Interoperability 534
The Last Word 536
CHAPTER 15 ASP.NET Web Services 537
Building Web Services for Silverlight 537
Creating a Web Service 538
Adding a Service Reference 539
Calling the Web Service 541
Configuring the Web Service URL 544
Web Service Data Types 546
More Advanced Web Services 548
Cross-Domain Web Service Calls 548
Monitoring the Network Connection 550
Using ASP.NET Platform Services 551
Duplex Services 553
Configuring the Service 554
The Interfaces 555
The Service 556
The Client 557
The Last Word 559
CHAPTER 16 Data Binding 560
Binding to Data Objects 561
Building a Data Object 561
Displaying a Data Object with DataContext 562
Storing a Data Object as a Resource 565
Editing with Two-Way Bindings 566
Validation 567
ValidatesOnExceptions 568
NotifyOnValidationError 570
The Validation Class 572
Change Notification 572
Building a Data Service 573
Calling the Data Service 576
Binding to a Collection of Objects 578
Displaying and Editing Collection Items 578
Inserting and Removing Collection Items 582
Binding to a LINQ Expression 583
Master-Details Display 585
Data Conversion 588
Formatting Strings with a Value Converter 589
Creating Objects with a Value Converter 593
Applying Conditional Formatting 595
Data Templates 598
Separating and Reusing Templates 600
More Advanced Templates 600
Changing Item Layout 602
The Last Word 603
CHAPTER 17 Data Controls 604
Better Data Forms 605
The Goal: Data Class Markup 605
The Label 605
The DescriptionViewer 608
The ValidationSummary 609
Data Annotations 611
Raising Annotation Errors 612
The Annotation Attributes 613
Required 614
StringLength 614
Range 614
RegularExpression 615
CustomValidation 617
Web Service Type Sharing 620
Identifying Your Data Classes 620
Setting Up the Visual Studio Solution 621
The DataGrid 623
Creating a Simple Grid 624
Resizing and Rearranging Columns 626
Defining Columns 627
The DataGridCheckBoxColumn 629
The DataGridTemplateColumn 629
Formatting and Styling Columns 630
Formatting Rows 632
Row Details 634
Freezing Columns 635
Selection 636
Sorting 637
DataGrid Editing 637
Editing with Templates 638
Validation and Editing Events 639
The PagedCollectionView 642
Sorting 643
Filtering 643
Grouping 644
Paging 646
The TreeView 649
Filling a TreeView 649
A Data-Bound TreeView 650
The Last Word 652
CHAPTER 18 Isolated Storage 653
Understanding Isolated Storage 653
The Scope of Isolated Storage 654
What to Put in Isolated Storage 654
Using Isolated Storage 655
Opening an Isolated Store 655
File Management 655
Writing and Reading Data 656
Requesting More Space 658
Storing Objects with XmlSerializer 661
Storing Application Settings 664
The File Dialogs 665
Reading Files with OpenFileDialog 666
Writing Files with SaveFileDialog 667
Transmitting Files with a Web Service 668
The File Service 669
The Silverlight Client 671
The Last Word 674
CHAPTER 19 Multithreading 675
Understanding Multithreading 675
The Goals of Multithreading 676
The DispatcherTimer 677
The Thread Class 677
Marshalling Code to the User Interface Thread 679
Creating a Thread Wrapper 681
Creating the Worker Class 683
Using the Thread Wrapper 684
Cancellation Support 686
The BackgroundWorker 688
Creating the BackgroundWorker 689
Running the BackgroundWorker 689
Tracking Progress 692
Supporting Cancellation 694
The Last Word 696
CHAPTER 20 Networking 697
Interacting with the Web 697
Cross-Domain Access 698
HTML Scraping 700
REST and Other Simple Web Services 704
Processing Different Types of Data 708
XML 708
Services That Return XML Data 710
Navigating Over an XDocument 712
Querying an XDocument with LINQ 715
Services That Require XML Data 717
Services That Return SOAP Data 719
Services That Return JSON Data 720
RSS 723
Sockets 726
Understanding Sockets and TCP 726
The Policy Server 728
The Policy File 729
The PolicyServer Classes 729
The PolicyConnection Classes 732
The Messaging Server 733
The Messenger Client 737
Connecting to the Server 737
Sending Messages 739
Receiving Messages 741
Local Connections 742
Sending a Message 743
Receiving a Message 743
The Last Word 744
Index 745

Erscheint lt. Verlag 28.2.2010
Zusatzinfo 640 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Grafik / Design
Informatik Programmiersprachen / -werkzeuge NET Programmierung
Mathematik / Informatik Informatik Software Entwicklung
Mathematik / Informatik Informatik Theorie / Studium
Mathematik / Informatik Informatik Web / Internet
Schlagworte Animation • ASP • ASP.NET • Control • Navigation • Technology • Video • Web Services • Windows Presentation Foundation • XAML
ISBN-10 1-4302-2428-2 / 1430224282
ISBN-13 978-1-4302-2428-0 / 9781430224280
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 10,9 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.

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
Expert-backed advice for information system design, down to .NET and …

von Jean-Philippe Gouigoux

eBook Download (2024)
Packt Publishing (Verlag)
38,39
Build practical projects with Blazor, .NET MAUI, gRPC, GraphQL, and …

von Mark J. Price

eBook Download (2023)
Packt Publishing (Verlag)
35,99