XAML Unleashed 9780133967401

Full Color: Figures and code appear as they do in Visual Studio. If you want to write Windows apps with XAML, one perso

2,959 549 69MB

English Pages 975 Year 2014

Report DMCA / Copyright

DOWNLOAD FILE

XAML Unleashed
 9780133967401

  • Commentary
  • Downloaded from https://www.oreilly.com/library/view/xaml-unleashed/9780133967401/ using OReilly Downloader

Table of contents :
About This eBook
Title Page
Copyright Page
Contents at a Glance
Table of Contents
About the Author
Dedication
Acknowledgments
We Want to Hear from You!
Reader Services
Introduction
In This Chapter
Who Should Read This Book?
Code Examples
How This Book Is Organized
Part I: The XAML Language
Part II: Graphics
Part III: Controls
Part IV: Exploiting XAML Features
Part V: Advanced Features
Conventions Used in This Book
Part I: The XAML Language
Chapter 1. What Is XAML?
Elements and Attributes
Namespaces
Property Elements
Summary
Chapter 2. Child Elements and Keywords
Children of Object Elements
The Content Property
Collection Items
XAML Keywords
Summary
Chapter 3. Mixing XAML with Code
Loading and Parsing XAML at Runtime
XamlReader
Naming XAML Elements
Compiling XAML
Binary XAML
Generated Source Code
Summary
Chapter 4. Extending XAML
Type Converters
Custom Type Converters
Type Conversion of an Element’s Contents
Using Arbitrary Types in XAML
Referencing .NET/WinRT Namespaces in XAML
Using Built-in System Data Types
Declaring Arrays
Referencing Static Fields and Properties
Markup Extensions
Some Notes About XAML2009
Full Generics Support
Dictionary Keys of Any Type
Built-in System Data Types
Instantiating Objects with Nondefault Constructors
Getting Instances via Factory Methods
Event Handler Flexibility
Defining New Properties
Summary
Part II: Graphics
Chapter 5. Arranging Elements
Controlling Size
Height and Width
Margin and Padding
Visibility
Controlling Position
Alignment
Content Alignment
FlowDirection
Applying 2D Transforms
RotateTransform
ScaleTransform
SkewTransform
TranslateTransform
Combining Transforms
Applying 3D Transforms
Summary
Chapter 6. Automatic Layout
Canvas
StackPanel
DockPanel
Grid
Sizing the Rows and Columns
Comparing Grid to Other Panels
VariableSizedWrapGrid and WrapPanel
Primitive Panels
TabPanel
ToolBarPanel
ToolBarOverflowPanel
ToolBarTray
UniformGrid
SelectiveScrollingGrid
Handling Content Overflow
Clipping
Scrolling
Scaling
Summary
Chapter 7. 2D Graphics
Shapes
Rectangle
Ellipse
Line
Polyline
Polygon
Path
Getting Fancy with Strokes
Geometries
PathFigures and PathSegments
GeometryGroup
Representing Geometries as Strings
Brushes
Color Brushes
Tile Brushes
Summary
Chapter 8. 3D Graphics
Getting Started with 3D Graphics
Cameras and Coordinate Systems
Position
LookDirection
UpDirection
OrthographicCamera Versus PerspectiveCamera
Transform3D
TranslateTransform3D
ScaleTransform3D
RotateTransform3D
Combining Transform3Ds
Model3D
Lights
GeometryModel3D
Model3DGroup
Visual3D
ModelVisual3D
UIElement3D
Viewport2DVisual3D
Viewport3D
2D and 3D Coordinate System Transformation
Visual.TransformToAncestor
Visual3D.TransformToAncestor and Visual3D.TransformToDescendant
Summary
Part III: Controls
Chapter 9. Content Controls
Button
HyperlinkButton
RepeatButton
ToggleButton
CheckBox
RadioButton
ToolTip
Summary
Chapter 10. Items Controls
Items in the Control
Items Panels
ComboBox
ListBox
ListView
Richer ScrollIntoView
Header and Footer
Selection
Reordering Items
Data Virtualization
Incremental Item Rendering
GridView
Summary
Chapter 11. Images
The Image Element
Referencing Files with URIs
Custom Stretching with Nine-Grid
Generating Dynamic Images with WriteableBitmap
Generating Dynamic Images with RenderTargetBitmap
Multiple Files for Multiple Environments
Loading File Variations Automatically
Loading File Variations Manually
Leveraging Resource Packages
Decoding Images
Getting Pixel Data
Reading Metadata
Encoding Images
Writing Pixel Data
Writing Metadata
Transcoding
Summary
Chapter 12. Text
TextBlock
Properties Introduced in Windows 8.1
Text Content
Text Elements
Text Selection
RichTextBlock
Embedding UIElements
Text Overflow
TextBox
Spelling and Text Prediction
Text Selection
InputScope and the Software Keyboard
RichEditBox
PasswordBox
Summary
Chapter 13. Audio and Video
Playback
The Media Content
Customizing Playback
States and Events
Markers
Adding Effects
Using MediaElement as a Media Player
MediaPlayer
Playing Custom Media Formats
Capture
CameraCaptureUI
CaptureElement
Transcoding
Changing the Quality
Changing the Format
Trimming
Adding Effects
Summary
Chapter 14. Other Controls
Range Controls
ProgressBar
Slider
Popup
Hub
HubSections
Jumping to a HubSection
DatePicker
TimePicker
ProgressRing
ToggleSwitch
Summary
Chapter 15. User Controls and Custom Controls
Creating a User Control
Creating the User Interface
Creating the Behavior
Consuming the User Control
Creating a Custom Control
Creating the Behavior
Creating the User Interface
Consuming the Control
Making the Control “Lookless”
Summary
Part IV: Exploiting XAML Features
Chapter 16. Resources
Binary Resources
Binary Resources in WPF
Binary Resources in Windows Store and Universal Apps
Logical Resources
Resource Lookup
Static Versus Dynamic Resources
Theme Resources
Summary
Chapter 17. Data Binding
Introducing Binding
Using Binding in C#
Binding to Plain Properties
Customizing the Data Flow
Sharing the Source with DataContext
Binding to a Collection
Controlling Rendering
Using Data Templates
Using Value Converters
Customizing the View of a Collection
Grouping
Navigating
Summary
Chapter 18. Styles, Templates, and Visual States
Styles
Using a Base TargetType
Style Inheritance
Implicit Styles
Templates
Introducing Control Templates
Respecting the Target Control’s Properties
Setting Template Inside a Style
Visual States
Responding to Visual State Changes
Visual Transitions
Summary
Chapter 19. Animation
Theme Transitions
Applying Theme Transitions to Elements
Examining the Theme Transitions
Theme Animations
Using a Storyboard
Examining the Theme Animations
Tweaking Theme Animations
Custom Animations
Independent Versus Dependent Animations
Controlling Duration
Flexibility with From and To
Tweaking Animations with Timeline Properties
Storyboards with Multiple Animations
Property Paths
Tweaking Storyboards with Timeline Properties
Custom Keyframe Animations
Linear Keyframes
Spline Keyframes
Discrete Keyframes
Easing Keyframes
Easing Functions
Power Easing Functions
Other Easing Functions
Manual Animations
Summary
Part V: Advanced Features
Chapter 20. Layout with Custom Panels
Communication Between Parents and Children
The Measure Step
The Arrange Step
Creating a SimpleCanvas
Creating a SimpleStackPanel
Creating a UniformGrid
Summary
Chapter 21. Fun with XAML Readers and Writers
System.Xaml Overview
The Node Loop
Reading XAML
Writing to Live Objects
Writing to XML
XamlServices
Summary
Index
Code Snippets

Polecaj historie