HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This PDF will be accessible from your Account page after purchase and requires PDF reading software, such as Acrobat® Reader®.
The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Full Color: Figures and code appear as they do in Visual Studio.
If you want to write Windows apps with XAML, one person can help you more than anyone else: Adam Nathan. He has built a well-deserved reputation as the world’s #1 expert on putting it to work. Now, he’s written the definitive, practical XAML tutorial and reference: XAML Unleashed.
Nathan answers the questions you’re most likely to ask, walks through the tasks you’re sure to perform, and helps you avoid problems as you use XAML. You’ll learn how to create effective user interfaces for line-of-business apps, consumer apps, reusable controls, or anything else. These techniques will be invaluable whether you’re creating universal Windows apps or working with Silverlight or WPF.
XAML Unleashed is packed with C# and XAML code examples that are fully color-coded to match their appearance in Visual Studio--the same approach that has made Nathan’s previous Unleashed books so popular.
Detailed information on how to...
Introduction 1
Who Should Read This Book? 2
Code Examples 2
How This Book Is Organized 2
Conventions Used in This Book 4
Part I: The XAML Language
Chapter 1: What Is XAML? 5
Elements and Attributes 6
Namespaces 9
Property Elements 11
Summary 13
Chapter 2: Child Elements and Keywords 15
Children of Object Elements 15
XAML Keywords 19
Summary 22
Chapter 3: Mixing XAML with Code 23
Loading and Parsing XAML at Runtime 23
Compiling XAML 26
Summary 30
Chapter 4: Extending XAML 31
Type Converters 31
Using Arbitrary Types in XAML 34
Markup Extensions 38
Some Notes About XAML2009 40
Summary 45
Part II: Graphics
Chapter 5: Arranging Elements 47
Controlling Size 48
Controlling Position 52
Applying 2D Transforms 55
Applying 3D Transforms 63
Summary 66
Chapter 6: Automatic Layout 67
Canvas 68
StackPanel 71
DockPanel 72
Grid 75
VariableSizedWrapGrid and WrapPanel 84
Primitive Panels 87
Handling Content Overflow 89
Summary 97
Chapter 7: 2D Graphics 99
Shapes 99
Geometries 107
Brushes 115
Summary 129
Chapter 8: 3D Graphics 131
Getting Started with 3D Graphics 131
Cameras and Coordinate Systems 135
Transform3D 147
Model3D 157
Visual3D 181
Viewport3D 186
2D and 3D Coordinate System Transformation 187
Summary 195
Part III: Controls
Chapter 9: Content Controls 197
Button 198
HyperlinkButton 199
RepeatButton 200
ToggleButton 201
CheckBox 201
RadioButton 202
ToolTip 203
Summary 205
Chapter 10: Items Controls 207
Items in the Control 208
Items Panels 209
ComboBox 212
ListBox 214
ListView 215
GridView 219
Summary 220
Chapter 11: Images 221
The Image Element 222
Multiple Files for Multiple Environments 231
Decoding Images 236
Encoding Images 244
Summary 252
Chapter 12: Text 253
TextBlock 253
RichTextBlock 265
TextBox 270
RichEditBox 276
PasswordBox 279
Summary 279
Chapter 13: Audio and Video 281
Playback 281
Capture 292
Transcoding 303
Summary 308
Chapter 14: Other Controls 311
Range Controls 311
Popup 314
Hub 316
DatePicker 322
TimePicker 323
ProgressRing 324
ToggleSwitch 325
Summary 326
Chapter 15: User Controls and Custom Controls 327
Creating a User Control 328
Creating a Custom Control 331
Summary 340
Part IV: Exploring XAML Features
Chapter 16: Resources 341
Binary Resources 341
Logical Resources 348
Summary 355
Chapter 17: Data Binding 357
Introducing Binding 357
Controlling Rendering 366
Customizing the View of a Collection 374
Summary 378
Chapter 18: Styles, Templates, and Visual States 379
Styles 380
Templates 386
Visual States 395
Summary 404
Chapter 19: Animation 405
Theme Transitions 406
Theme Animations 417
Custom Animations 422
Custom Keyframe Animations 435
Easing Functions 439
Manual Animations 444
Summary 446
Part V: Advanced Features
Chapter 20: Layout with Custom Panels 447
Communication Between Parents and Children 448
Creating a SimpleCanvas 451
Creating a SimpleStackPanel 455
Creating a UniformGrid 458
Summary 463
Chapter 21: Fun with XAML Readers and Writers 465
System.Xaml Overview 465
The Node Loop 468
Reading XAML 469
Writing to Live Objects 473
Writing to XML 475
XamlServices 476
Summary 478
Index 479