![]()
Windows Presentation Foundation 4.5 Cookbook
Table of Contents
Windows Presentation Foundation 4.5 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Foundations
Introduction
XAML
XAML and compilation
Dependency properties
Creating custom type instances in XAML
Getting ready
How to do it...
How it works...
There's more...
Creating a dependency property
Getting ready
How to do it...
How it works...
There's more...
Property value inheritance
Why "dependency"?
Dependency property levels
Using an attached property
Getting ready
How to do it...
How it works...
There's more...
Why an attached property?
Does the declaring type "own" the property?
See also
Creating an attached property
Getting ready
How to do it...
How it works...
There's more...
Reusing existing attached properties
See also
Accessing a static property from XAML
Getting ready
How to do it...
How it works...
There's more...
Creating a custom markup extension
Getting ready
How to do it...
How it works...
There's more...
Don't go overboard
Handling routed events
Getting ready
How to do it...
How it works...
There's more...
Stopping bubbling or tunneling
Attached events
2. Resources
Introduction
Using logical resources
Getting ready
How to do it...
How it works...
There's more...
Adding or deleting resources dynamically
Modifying resources
Resources that use other resources
Non-shared resources
Other locations for resources
Dynamically binding to a logical resource
Getting ready
How to do it...
How it works...
There's more...
Using user-selected colors and fonts
Getting ready
How to do it...
How it works...
There's more...
Using binary resources
Getting ready
How to do it...
How it works...
There's more...
Embedded Resource
Accessing binary resources in code
Getting ready
How to do it...
How it works...
There's more...
Accessing binary resources from another assembly
Getting ready
How to do it...
How it works...
There's more...
Managing logical resources
Getting ready
How to do it...
How it works...
There's more...
Duplicated keys
3. Layout and Panels
Introduction
The layout process
Coordinates systems in WPF
Creating a table-like user interface
Getting ready
How to do it...
How it works...
There's more...
Shared row/column size
Placement in the same cell
The power of the Grid
Adding rows/columns dynamically
The UniformGrid
Dynamically sizing grid rows/columns
Getting ready
How to do it...
How it works...
There's more...
Creating a scrollable user interface
Getting ready
How to do it...
How it works...
There's more...
Creating a border around panels and elements
Getting ready
How to do it...
How it works...
Placing elements in exact positions
Getting ready
How to do it...
How it works...
There's more...
Canvas has no background
Canvas is not limited to its bounds
Adding/removing elements to a panel dynamically
Getting ready
How to do it...
How it works...
Creating a tabbed user interface
Getting ready
How to do it...
How it works...
There's more...
Implementing drag-and-drop
Getting ready
How to do it...
How it works...
There's more...
Built-in drag-and-drop
Drag-and-drop to other applications
4. Using Standard Controls
Introduction
Working with text
Getting ready
How to do it...
How it works...
There's more...
Using content controls
Getting ready
How to do it...
How it works...
There's more...
Headered content controls
See also
Displaying images
Getting ready
How to do it...
How it works...
There's more...
See also
Creating tooltips
Getting ready
How to do it...
How it works...
There's more...
Deeper tooltip customization
Realistic tooltips
Creating a list of items
Getting ready
How to do it…
How it works...
There's more...
Creating a standard menu
Getting ready
How to do it…
How it works...
There's more...
Other MenuItem properties and events
Creating a context menu
Getting ready
How to do it…
How it works...
There's more...
Selecting options with checkboxes and radio buttons
Getting ready
How to do it…
How it works...
Manipulating tab order and focus
Getting ready
How to do it…
How it works...
There's more...
Keyboard focus versus logical focus
5. Application and Windows
Introduction
Creating a window
Getting ready
How to do it...
How it works...
There's more...
Selecting the startup window dynamically
Accessing command line arguments
Creating a dialog box
Getting ready
How to do it...
How it works...
There's more...
Modeless dialogs
Using the common dialog boxes
Getting ready
How to do it...
How it works...
There's more...
What about colors and fonts?
The Windows API Code Pack
Creating ownership between windows
Getting ready
How to do it...
How it works...
There's more...
Creating a custom shaped window
Getting ready
How to do it...
How it works...
There's more...
What about reusability?
Creating a single instance application
Getting ready
How to do it...
How it works...
There's more...
Handling an unhandled exception
Getting ready
How to do it...
How it works...
There's more...
6. Data Binding
Introduction
Element to element binding
Getting ready
How to do it...
How it works...
...