Home Page Icon
Home Page
Table of Contents for
About the Authors
Close
About the Authors
by Sam Noble, Sam Bourton, Allen Jones
WPF Recipes in C# 2008: A Problem-Solution Approach
Copyright
About the Authors
About the Technical Reviewer
Acknowledgments
1. Building and Debugging WPF Applications
1.1. Create a Standard WPF Application
1.1.1. Problem
1.1.2. Solution
1.1.3. How It Works
1.1.3.1. The Code
1.2. Handle an Unhandled Exception
1.2.1. Problem
1.2.2. Solution
1.2.3. How It Works
1.2.3.1. The Code
1.3. Create and Use a Dependency Property
1.3.1. Problem
1.3.2. Solution
1.3.3. How It Works
1.3.3.1. The Code
1.4. Create a Read-Only Dependency Property
1.4.1. Problem
1.4.2. Solution
1.4.3. How It Works
1.4.3.1. The Code
1.5. Override a Dependency Property's Metadata
1.5.1. Problem
1.5.2. Solution
1.5.3. How It Works
1.5.3.1. The Code
1.6. Add a PropertyChangedValueCallback to Any Dependency Property
1.6.1. Problem
1.6.2. Solution
1.6.3. How It Works
1.6.3.1. The Code
1.7. Add Validation to a Dependency Property
1.7.1. Problem
1.7.2. Solution
1.7.3. How It Works
1.7.3.1. The Code
1.8. Create and Use an Attached Property
1.8.1. Problem
1.8.2. Solution
1.8.3. How It Works
1.8.3.1. The Code
1.9. Create a Dependency Property with Property Value Inheritance
1.9.1. Problem
1.9.2. Solution
1.9.3. How It Works
1.9.3.1. The Code
1.10. Merge Two Resource Dictionaries
1.10.1. Problem
1.10.2. Solution
1.10.3. How It Works
1.10.3.1. The Code
1.11. Define Application-wide Resources
1.11.1. Problem
1.11.2. Solution
1.11.3. How It Works
1.11.3.1. The Code
1.12. Reference a ResourceDictionary in a Different Assembly
1.12.1. Problem
1.12.2. Solution
1.12.3. How It Works
1.12.3.1. The Code
1.13. Share Properties Throughout an Application
1.13.1. Problem
1.13.2. Solution
1.13.3. How It Works
1.13.3.1. The Code
1.14. Create a Single-Instance Application
1.14.1. Problem
1.14.2. Solution
1.14.3. How It Works
1.14.3.1. The Code
1.15. Manage Multiple Windows in an Application
1.15.1. Problem
1.15.2. Solution
1.15.3. How It Works
1.15.3.1. The Code
1.16. Debug Data Bindings Using an IValueConverter
1.16.1. Problem
1.16.2. Solution
1.16.3. How It Works
1.16.3.1. The Code
1.17. Debug Bindings Using Attached Properties
1.17.1. Problem
1.17.2. Solution
1.17.3. How It Works
1.17.3.1. The Code
2. Working with Windows, Forms, and Layout Management
2.1. Automatically Size the Main Application Window to Accommodate Its Content
2.1.1. Problem
2.1.2. Solution
2.1.3. How it Works
2.1.3.1. The Code
2.2. Arrange UI Elements in a Horizontal or Vertical Stack
2.2.1. Problem
2.2.2. Solution
2.2.3. How It Works
2.2.3.1. The Code
2.3. Arrange UI Elements into Automatically Wrapping Rows or Columns
2.3.1. Problem
2.3.2. Solution
2.3.3. How It Works
2.3.3.1. The Code
2.4. Dock UI Elements to the Edges of a Form
2.4.1. Problem
2.4.2. Solution
2.4.3. How It Works
2.4.3.1. The Code
2.5. Arrange UI Elements in a Grid
2.5.1. Problem
2.5.2. Solution
2.5.3. How It Works
2.5.3.1. The Code
2.6. Position UI Elements Using Exact Coordinates
2.6.1. Problem
2.6.2. Solution
2.6.3. How It Works
2.6.3.1. The Code
2.7. Display Content in a Multitabbed User Interface
2.7.1. Problem
2.7.2. Solution
2.7.3. How It Works
2.7.3.1. The Code
2.8. Display Content in a Scrollable User Interface
2.8.1. Problem
2.8.2. Solution
2.8.3. How It Works
2.8.3.1. The Code
2.9. Display Content in Resizable Split Panel
2.9.1. Problem
2.9.2. Solution
2.9.3. How It Works
2.9.3.1. The Code
2.10. Display Content in an Expander
2.10.1. Problem
2.10.2. Solution
2.10.3. How It Works
2.10.3.1. The Code
2.11. Place a Group Box Around a Set of UI Elements
2.11.1. Problem
2.11.2. Solution
2.11.3. How It Works
2.11.3.1. The Code
2.12. Display a Message Box
2.12.1. Problem
2.12.2. Solution
2.12.3. How It Works
2.12.3.1. The Code
2.13. Display a Pop-up Window
2.13.1. Problem
2.13.2. Solution
2.13.3. How It Works
2.13.3.1. The Code
2.14. Display a Border
2.14.1. Problem
2.14.2. Solution
2.14.3. How It Works
2.14.3.1. The Code
2.15. Display a Menu
2.15.1. Problem
2.15.2. Solution
2.15.3. How It Works
2.15.3.1. The Code
2.16. Display a Toolbar
2.16.1. Problem
2.16.2. Solution
2.16.3. How It Works
2.16.3.1. The Code
2.17. Display a Status Bar
2.17.1. Problem
2.17.2. Solution
2.17.3. How It Works
2.17.3.1. The Code
2.18. Control the Size of UI Elements in a Form
2.18.1. Problem
2.18.2. Solution
2.18.3. How It Works
2.18.3.1. The Code
2.19. Define the Tab Order of UI Elements in a Form
2.19.1. Problem
2.19.2. Solution
2.19.3. How It Works
2.19.3.1. The Code
3. Using Standard Controls
3.1. Display Control Content Surrounded by Braces
3.1.1. Problem
3.1.2. Solution
3.1.3. How It Works
3.1.3.1. The Code
3.2. Display Simple Text
3.2.1. Problem
3.2.2. Solution
3.2.3. How It Works
3.2.3.1. The Code
3.3. Display a Static Image
3.3.1. Problem
3.3.2. Solution
3.3.3. How It Works
3.3.3.1. The Code
3.4. Get Simple Text Input from a User
3.4.1. Problem
3.4.2. Solution
3.4.3. How It Works
3.4.3.1. The Code
3.5. Get Rich Text Input from a User
3.5.1. Problem
3.5.2. Solution
3.5.3. How It Works
3.5.3.1. The Code
3.6. Load or Save the Content of a RichTextBox
3.6.1. Problem
3.6.2. Solution
3.6.3. How It Works
3.6.3.1. The Code
3.7. Display a Password Entry Box
3.7.1. Problem
3.7.2. Solution
3.7.3. How It Works
3.7.3.1. The Code
3.8. Spell Check a TextBox or RichTextBox Control in Real Time
3.8.1. Problem
3.8.2. Solution
3.8.3. How It Works
3.8.3.1. The Code
3.9. Handle a Button Click
3.9.1. Problem
3.9.2. Solution
3.9.3. How It Works
3.9.3.1. The Code
3.10. Generate Click Events Repeatedly While a Button Is Clicked
3.10.1. Problem
3.10.2. Solution
3.10.3. How It Works
3.10.3.1. The Code
3.11. Set a Default Button
3.11.1. Problem
3.11.2. Solution
3.11.3. How It Works
3.11.3.1. The Code
3.12. Provide Quick Keyboard Access to Text Boxes
3.12.1. Problem
3.12.2. Solution
3.12.3. How It Works
3.12.3.1. The Code
3.13. Provide Quick Keyboard Access to Buttons
3.13.1. Problem
3.13.2. Solution
3.13.3. How It Works
3.13.3.1. The Code
3.14. Get User Input from a Slider
3.14.1. Problem
3.14.2. Solution
3.14.3. How It Works
3.14.3.1. The Code
3.15. Display a Context Menu
3.15.1. Problem
3.15.2. Solution
3.15.3. How It Works
3.15.3.1. The Code
3.16. Display a Tool Tip on a Control
3.16.1. Problem
3.16.2. Solution
3.16.3. How It Works
3.16.3.1. The Code
3.17. Display a Tool Tip on a Disabled Control
3.17.1. Problem
3.17.2. Solution
3.17.3. How It Works
3.17.3.1. The Code
3.18. Control the Display Duration and Position of a Tool Tip
3.18.1. Problem
3.18.2. Solution
3.18.3. How It Works
3.18.3.1. The Code
3.19. View and Select Items from a Set of Radio Buttons
3.19.1. Problem
3.19.2. Solution
3.19.3. How It Works
3.19.3.1. The Code
3.20. View and Select Items from a Set of Check Boxes
3.20.1. Problem
3.20.2. Solution
3.20.3. How It Works
3.20.3.1. The Code
3.21. View and Select Items Using a Tree
3.21.1. Problem
3.21.2. Solution
3.21.3. How It Works
3.21.3.1. The Code
3.22. View and Select Items Using a List
3.22.1. Problem
3.22.2. Solution
3.22.3. How It Works
3.22.3.1. The Code
3.23. Dynamically Add Items to a List
3.23.1. Problem
3.23.2. Solution
3.23.3. How It Works
3.23.3.1. The Code
3.24. View and Select Items Using a Combo Box
3.24.1. Problem
3.24.2. Solution
3.24.3. How It Works
3.24.3.1. The Code
3.25. Display a Control Rotated
3.25.1. Problem
3.25.2. Solution
3.25.3. How It Works
3.25.3.1. The Code
4. Creating User and Custom Controls
4.1. Create a User Control
4.1.1. Problem
4.1.2. Solution
4.1.3. How It Works
4.1.3.1. The Code
4.2. Set the Content Property of a User Control
4.2.1. Problem
4.2.2. Solution
4.2.3. How It Works
4.2.3.1. The Code
4.3. Add Properties to a User Control
4.3.1. Problem
4.3.2. Solution
4.3.3. How It Works
4.3.3.1. The Code
4.4. Add Events to a User Control
4.4.1. Problem
4.4.2. Solution
4.4.3. How It Works
4.4.3.1. The Code
4.5. Support Application Commands in a User Control
4.5.1. Problem
4.5.2. Solution
4.5.3. How It Works
4.5.3.1. The Code
4.6. Add Custom Commands to a User Control
4.6.1. Problem
4.6.2. Solution
4.6.3. How It Works
4.6.3.1. The Code
4.7. Set Design Mode Behavior in a User Control
4.7.1. Problem
4.7.2. Solution
4.7.3. How It Works
4.7.3.1. The Code
4.8. Create a Lookless Custom Control
4.8.1. Problem
4.8.2. Solution
4.8.3. How It Works
4.8.3.1. The Code
4.9. Specify the Parts Required by a Custom Control
4.9.1. Problem
4.9.2. Solution
4.9.3. How It Works
4.9.3.1. The Code
4.10. Support UI Automation in a Custom Control
4.10.1. Problem
4.10.2. Solution
4.10.3. How It Works
4.10.3.1. The Code
4.11. Create a Custom-Drawn Element
4.11.1. Problem
4.11.2. Solution
4.11.3. How It Works
4.11.3.1. The Code
4.12. Create a Numeric TextBox Control
4.12.1. Problem
4.12.2. Solution
4.12.3. How It Works
4.12.3.1. The Code
4.13. Create a Scrollable Canvas Control
4.13.1. Problem
4.13.2. Solution
4.13.3. How It Works
4.13.3.1. The Code
4.14. Create a Zoomable Canvas Control
4.14.1. Problem
4.14.2. Solution
4.14.3. How It Works
4.14.3.1. The Code
4.15. Create a Drag Canvas Control
4.15.1. Problem
4.15.2. Solution
4.15.3. How It Works
4.15.3.1. The Code
5. Data Binding
5.1. Bind to a Property of a UI Element
5.1.1. Problem
5.1.2. Solution
5.1.3. How It Works
5.1.3.1. The Code
5.2. Create a Two-Way Binding
5.2.1. Problem
5.2.2. Solution
5.2.3. How It Works
5.2.3.1. The Code
5.3. Bind a Property of an Element to Itself
5.3.1. Problem
5.3.2. Solution
5.3.3. How It Works
5.3.3.1. The Code
5.4. Bind to CLR Objects
5.4.1. Problem
5.4.2. Solution
5.4.3. How It Works
5.4.3.1. The Code
5.5. Bind to an Existing Object Instance
5.5.1. Problem
5.5.2. Solution
5.5.3. How It Works
5.5.3.1. The Code
5.6. Bind to XML Data
5.6.1. Problem
5.6.2. Solution
5.6.3. How It Works
5.6.3.1. The Code
5.7. Bind to a Method
5.7.1. Problem
5.7.2. Solution
5.7.3. How It Works
5.7.3.1. The Code
5.8. Bind to a Command
5.8.1. Problem
5.8.2. Solution
5.8.3. How It Works
5.8.3.1. The Code
5.9. Bind to the Values of an Enumeration
5.9.1. Problem
5.9.2. Solution
5.9.3. How It Works
5.9.3.1. The Code
5.10. Specify a Default Value for a Binding
5.10.1. Problem
5.10.2. Solution
5.10.3. How It Works
5.10.3.1. The Code
5.11. Use Data Templates to Display Bound Data
5.11.1. Problem
5.11.2. Solution
5.11.3. How It Works
5.11.3.1. The Code
5.12. Use Value Converters to Convert Bound Data
5.12.1. Problem
5.12.2. Solution
5.12.3. How It Works
5.12.3.1. The Code
5.13. Use Data Triggers to Change the Appearance of Bound Data
5.13.1. Problem
5.13.2. Solution
5.13.3. How It Works
5.13.3.1. The Code
5.14. Select a DataTemplate Based on Properties of the Data Object
5.14.1. Problem
5.14.2. Solution
5.14.3. How It Works
5.14.3.1. The Code
5.15. Specify Validation Rules for a Binding
5.15.1. Problem
5.15.2. Solution
5.15.3. How It Works
5.15.3.1. The Code
5.16. Bind to IDataErrorInfo
5.16.1. Problem
5.16.2. Solution
5.16.3. How It Works
5.16.3.1. The Code
5.17. Bind to a Collection with the Master-Detail Pattern
5.17.1. Problem
5.17.2. Solution
5.17.3. How It Works
5.17.3.1. The Code
5.18. Sort Data in a Collection
5.18.1. Problem
5.18.2. Solution
5.18.3. How It Works
5.18.3.1. The Code
5.19. Apply Custom Sorting Logic to a Collection
5.19.1. Problem
5.19.2. Solution
5.19.3. How It Works
5.19.3.1. The Code
5.20. Filter Data in a Collection
5.20.1. Problem
5.20.2. Solution
5.20.3. How It Works
5.20.3.1. The Code
5.21. Group Data in a Collection
5.21.1. Problem
5.21.2. Solution
5.21.3. How It Works
5.21.3.1. The Code
5.22. Apply Custom Grouping to a Collection
5.22.1. Problem
5.22.2. Solution
5.22.3. How It Works
5.22.3.1. The Code
5.23. Bind to Application Settings
5.23.1. Problem
5.23.2. Solution
5.23.3. How It Works
5.23.3.1. The Code
5.24. Bind to Application Resource Strings
5.24.1. Problem
5.24.2. Solution
5.24.3. How It Works
5.24.3.1. The Code
6. Working with Styles, Templates, Skins, and Themes
6.1. Create a Named Style
6.1.1. Problem
6.1.2. Solution
6.1.3. How It Works
6.1.4. The Code
6.2. Create a Typed Style
6.2.1. Problem
6.2.2. Solution
6.2.3. How It Works
6.2.4. The Code
6.3. Override Style Properties
6.3.1. Problem
6.3.2. Solution
6.3.3. How It Works
6.3.4. The Code
6.4. Inherit from a Common Base Style
6.4.1. Problem
6.4.2. Solution
6.4.3. How It Works
6.4.4. The Code
6.5. Change a Control's Appearance on Mouse Over
6.5.1. Problem
6.5.2. Solution
6.5.3. How It Works
6.5.4. The Code
6.6. Apply Multiple Triggers to the Same Element
6.6.1. Problem
6.6.2. Solution
6.6.3. How It Works
6.6.4. The Code
6.7. Evaluate Multiple Properties for the Same Trigger
6.7.1. Problem
6.7.2. Solution
6.7.3. How It Works
6.7.3.1. The Code
6.8. Programmatically Extract an Element's Style
6.8.1. Problem
6.8.2. Solution
6.8.3. How It Works
6.8.4. The Code
6.9. Set a Style Programmatically
6.9.1. Problem
6.9.2. Solution
6.9.3. How It Works
6.9.3.1. The Code
6.10. Ignore an Implicit Style
6.10.1. Problem
6.10.2. Solution
6.10.3. How It Works
6.10.3.1. The Code
6.11. Change the Appearance of Alternate Items in a List
6.11.1. Problem
6.11.2. Solution
6.11.3. How It Works
6.11.3.1. The Code
6.12. Change the Appearance of a List Item When It's Selected
6.12.1. Problem
6.12.2. Solution
6.12.3. How It Works
6.12.3.1. The Code
6.13. Create a Control Template
6.13.1. Problem
6.13.2. Solution
6.13.3. How It Works
6.13.4. The Code
6.14. Put a Control Template into a Style
6.14.1. Problem
6.14.2. Solution
6.14.3. How It Works
6.14.3.1. The Code
6.15. Create a Control Template That Can Be Customized by Properties
6.15.1. Problem
6.15.2. Solution
6.15.3. How It Works
6.15.3.1. The Code
6.16. Specify Named Parts of a Control Template
6.16.1. Problem
6.16.2. Solution
6.16.3. How It Works
6.16.3.1. The Code
6.17. Find ControlTemplate-Generated Elements
6.17.1. Problem
6.17.2. Solution
6.17.3. How It Works
6.17.3.1. The Code
6.18. Create a Custom ToolTip Style
6.18.1. Problem
6.18.2. Solution
6.18.3. How It Works
6.18.3.1. The Code
6.19. Dynamically Change the Skin of an Application
6.19.1. Problem
6.19.2. Solution
6.19.3. How It Works
6.19.3.1. The Code
6.20. Create Styles That Adapt to the Current OS Theme
6.20.1. Problem
6.20.2. Solution
6.20.3. How It Works
6.20.3.1. The Code
7. Working with Text, Documents, and Printing
7.1. Programmatically Insert Text into a RichTextBox
7.1.1. Problem
7.1.2. Solution
7.1.3. How It Works
7.1.3.1. The Code
7.2. Apply Syntax Highlighting in a Text Control
7.2.1. Problem
7.2.2. Solution
7.2.3. How It Works
7.2.3.1. The Code
7.3. Print a WPF Visual
7.3.1. Problem
7.3.2. The Solution
7.3.3. How It Works
7.3.3.1. The Code
7.4. Print a Collection of WPF Visuals
7.4.1. Problem
7.4.2. Solution
7.4.3. How It Works
7.4.3.1. The Code
7.5. Configure Printing Options Using a PrintTicket
7.5.1. Problem
7.5.2. Solution
7.5.3. How It Works
7.5.3.1. The Code
7.6. Print a Simple Document
7.6.1. Problem
7.6.2. Solution
7.6.3. How It Works
7.6.3.1. The Code
7.7. Asynchronously Print a Multipage FixedDocument
7.7.1. Problem
7.7.2. Solution
7.7.3. How It Works
7.7.3.1. The Code
7.8. Programmatically Create and Save a Simple FixedDocument
7.8.1. Problem
7.8.2. Solution
7.8.3. How It Works
7.8.3.1. The Code
7.9. Use Figures and Floaters in a FlowDocument
7.9.1. Problem
7.9.2. Solution
7.9.3. How It Works
7.9.3.1. The Code
7.10. Programmatically Create and Save a FlowDocument
7.10.1. Problem
7.10.2. Solution
7.10.3. How It Works
7.10.3.1. The Code
7.11. Asynchronously Save a FixedDocument to an XPS File
7.11.1. Problem
7.11.2. Solution
7.11.3. How It Works
7.11.3.1. The Code
7.12. Display a Document
7.12.1. Problem
7.12.2. Solution
7.12.3. How It Works
7.12.3.1. The Code
7.13. Annotate a Document with Sticky Notes
7.13.1. Problem
7.13.2. Solution
7.13.3. How It Works
7.13.3.1. The Code
7.14. Use Highlighting in a Document
7.14.1. Problem
7.14.2. Solution
7.14.3. How It Works
7.14.3.1. The Code
7.15. Load and Save User-Defined Annotations
7.15.1. Problem
7.15.2. Solution
7.15.3. How It Works
7.15.3.1. The Code
7.16. Print a Document's Annotations
7.16.1. Problem
7.16.2. Solution
7.16.3. How It Works
7.16.3.1. The Code
8. Multithreading
8.1. Execute a Method Asynchronously Using the Dispatcher Queue
8.1.1. Problem
8.1.2. Solution
8.1.3. How It Works
8.1.3.1. The Code
8.2. Load the Data for a Window Asynchronously After It Has Rendered
8.2.1. Problem
8.2.2. Solution
8.2.3. How It Works
8.2.3.1. The Code
8.3. Load the Items in a ListBox Asynchronously
8.3.1. Problem
8.3.2. Solution
8.3.3. How It Works
8.3.3.1. The Code
8.4. Check Whether You Are Running on the UI Thread
8.4.1. Problem
8.4.2. Solution
8.4.3. How It Works
8.4.3.1. The Code
8.5. Ensure That You Are Running on the UI Thread
8.5.1. Problem
8.5.2. Solution
8.5.3. How It Works
8.5.3.1. The Code
8.6. Execute a Method Asynchronously Using a Background Worker Thread
8.6.1. Problem
8.6.2. Solution
8.6.3. How It Works
8.6.3.1. The Code
8.7. Track the Progress of a Background Worker Thread
8.7.1. Problem
8.7.2. Solution
8.7.3. How It Works
8.7.3.1. The Code
8.8. Support the Cancellation of a Background Worker Thread
8.8.1. Problem
8.8.2. Solution
8.8.3. How It Works
8.8.3.1. The Code
8.9. Create a Background Worker Thread in XAML
8.9.1. Problem
8.9.2. Solution
8.9.3. How It Works
8.9.3.1. The Code
8.10. Update the UI Asynchronously on a Timer
8.10.1. Problem
8.10.2. Solution
8.10.3. How It Works
8.10.3.1. The Code
8.11. Show a Continuous Animation During an Asynchronous Process
8.11.1. Problem
8.11.2. Solution
8.11.3. How It Works
8.11.3.1. The Code
8.12. Show a ProgressBar While Processing on a Background Thread
8.12.1. Problem
8.12.2. Solution
8.12.3. How It Works
8.12.3.1. The Code
8.13. Show a Cancellable ProgressBar While Processing on a Background Thread
8.13.1. Problem
8.13.2. Solution
8.13.3. How It Works
8.13.3.1. The Code
8.14. Show a Continuous Progress Bar While Processing on a Background Thread
8.14.1. Problem
8.14.2. Solution
8.14.3. How It Works
8.14.3.1. The Code
8.15. Implement Application.DoEvents in WPF
8.15.1. Problem
8.15.2. Solution
8.15.3. How It Works
8.15.3.1. The Code
8.16. Create a Separate Thread for Each Window in a Multiwindow Application
8.16.1. Problem
8.16.2. Solution
8.16.3. How It Works
8.16.3.1. The Code
9. Working with 2D Graphics
9.1. Draw a Line
9.1.1. Problem
9.1.2. Solution
9.1.3. How It Works
9.1.3.1. The Code
9.2. Draw a Sequence of Connected Lines
9.2.1. Problem
9.2.2. Solution
9.2.3. How It Works
9.2.3.1. The Code
9.3. Format Lines
9.3.1. Problem
9.3.2. Solution
9.3.3. How It Works
9.3.3.1. The Code
9.4. Draw a Curved Line
9.4.1. Problem
9.4.2. Solution
9.4.3. How It Works
9.4.3.1. The Code
9.5. Draw Simple Shapes
9.5.1. Problem
9.5.2. Solution
9.5.3. How It Works
9.5.3.1. The Code
9.6. Draw Complex Shapes
9.6.1. Problem
9.6.2. Solution
9.6.3. How It Works
9.6.3.1. The Code
9.7. Create Reusable Shapes
9.7.1. Problem
9.7.2. Solution
9.7.3. How It Works
9.7.3.1. The Code
9.8. Display a Tool Tip on a Shape
9.8.1. Problem
9.8.2. Solution
9.8.3. How It Works
9.8.3.1. The Code
9.9. Display Graphics Elements in a Tool Tip
9.9.1. Problem
9.9.2. Solution
9.9.3. How It Works
9.9.3.1. The Code
9.10. Use System Colors in Your Graphics
9.10.1. Problem
9.10.2. solution
9.10.3. How It Works
9.10.3.1. The Code
9.11. Draw or Fill a Shape Using a Solid Color
9.11.1. Problem
9.11.2. Solution
9.11.3. How It Works
9.11.3.1. The Code
9.12. Fill a Shape with a Linear or Radial Color Gradient
9.12.1. Problem
9.12.2. Solution
9.12.3. How It Works
9.12.3.1. The Code
9.13. Fill a Shape with an Image
9.13.1. Problem
9.13.2. Solution
9.13.3. How It Works
9.13.3.1. The Code
9.14. Fill a Shape with a Pattern or Texture
9.14.1. Problem
9.14.2. Solution
9.14.3. How It Works
9.14.3.1. The Code
9.15. Fill a Shape with a View of Active UI Elements
9.15.1. Problem
9.15.2. Solution
9.15.3. How It Works
9.15.3.1. The Code
9.16. Apply Blur Effects on UI Elements
9.16.1. Problem
9.16.2. Solution
9.16.3. How It Works
9.16.3.1. The Code
9.17. Apply a Glow Effect to Your UI Elements
9.17.1. Problem
9.17.2. Solution
9.17.3. How It Works
9.17.3.1. The Code
9.18. Apply a Drop Shadow Effect to Your UI Elements
9.18.1. Problem
9.18.2. Solution
9.18.3. How It Works
9.18.3.1. The Code
9.19. Scale, Skew, Rotate, or Position Graphics Elements
9.19.1. Problem
9.19.2. Solution
9.19.3. How It Works
9.19.3.1. The Code
10. Working with 3D Graphics
10.1. Use 3D in Your Application
10.1.1. Problem
10.1.2. Solution
10.1.3. How It Works
10.1.3.1. The Code
10.2. Use a 3D Camera
10.2.1. Problem
10.2.2. Solution
10.2.3. How It Works
10.2.3.1. The Code
10.3. Draw a 3D Model
10.3.1. Problem
10.3.2. Solution
10.3.3. How It Works
10.3.3.1. The Code
10.4. Light a Scene
10.4.1. Problem
10.4.2. Solution
10.4.3. How It Works
10.4.3.1. The Code
10.5. Specify a Material for a Model
10.5.1. Problem
10.5.2. Solution
10.5.3. How It Works
10.5.3.1. The Code
10.6. Apply Textures to a Model
10.6.1. Problem
10.6.2. Solution
10.6.3. How It Works
10.6.3.1. The Code
10.7. Interact with 3D Objects
10.7.1. Problem
10.7.2. Solution
10.7.3. How It Works
10.7.3.1. The Code
10.8. Use a 2D Control in a 3D Scene
10.8.1. Problem
10.8.2. Solution
10.8.3. How It Works
10.8.3.1. The Code
11. Creating Animation
11.1. Animate the Property of a Control
11.1.1. Problem
11.1.2. Solution
11.1.3. How It Works
11.1.3.1. The Code
11.2. Animate a Property of a Control Set with a Data Binding
11.2.1. Problem
11.2.2. Solution
11.2.3. How It Works
11.2.3.1. The Code
11.3. Remove Animations
11.3.1. Problem
11.3.2. Solution
11.3.3. How It Works
11.3.3.1. The Code
11.4. Overlap Animations
11.4.1. Problem
11.4.2. Solution
11.4.3. How It Works
11.4.3.1. The Code
11.5. Animate Several Properties in Parallel
11.5.1. Problem
11.5.2. Solution
11.5.3. How It Works
11.5.3.1. The Code
11.6. Create a Keyframe-Based Animation
11.6.1. Problem
11.6.2. Solution
11.6.3. How It Works
11.6.3.1. The Code
11.7. Control the Progress of an Animation
11.7.1. Problem
11.7.2. Solution
11.7.3. How It Works
11.7.3.1. The Code
11.8. Animate the Shape of a Path
11.8.1. Problem
11.8.2. Solution
11.8.3. How It Works
11.8.3.1. The Code
11.9. Loop and Reverse an Animation
11.9.1. Problem
11.9.2. Solution
11.9.3. How It Works
11.9.3.1. The Code
11.10. Limit the Frame Rate of a Storyboard
11.10.1. Problem
11.10.2. Solution
11.10.3. How It Works
11.10.3.1. The Code
11.11. Limit the Frame Rate for All Animations in an Application
11.11.1. Problem
11.11.2. Solution
11.11.3. How It Works
11.11.3.1. The Code
11.12. Animate an Object Along a Path
11.12.1. Problem
11.12.2. Solution
11.12.3. How It Works
11.12.3.1. The Code
11.13. Play Back Audio or Video with a MediaTimeline
11.13.1. Problem
11.13.2. Solution
11.13.3. How It Works
11.13.3.1. The Code
11.14. Synchronize Timeline Animations with a MediaTimeline
11.14.1. Problem
11.14.2. Solution
11.14.3. How It Works
11.14.3.1. The Code
11.15. Receive Notification When an Animation Completes
11.15.1. Problem
11.15.2. Solution
11.15.3. How It Works
11.15.3.1. The Code
11.16. Animate the Color of a Brush with Indirect Property Targeting
11.16.1. Problem
11.16.2. Solution
11.16.3. How It Works
11.16.3.1. The Code
11.17. Control Animations Through Triggers
11.17.1. Problem
11.17.2. Solution
11.17.3. How It Works
11.17.3.1. The Code
11.18. Animate Text
11.18.1. Problem
11.18.2. Solution
11.18.3. How It Works
11.18.3.1. The Code
12. Dealing with Multimedia and User Input
12.1. Play System Sounds
12.1.1. Problem
12.1.2. Solution
12.1.3. How It Works
12.1.3.1. The Code
12.2. Use Triggers to Play Audio When a User Interacts with a Control
12.2.1. Problem
12.2.2. Solution
12.2.3. How It Works
12.2.3.1. The Code
12.3. Play a Media File
12.3.1. Problem
12.3.2. Solution
12.3.3. How It Works
12.3.3.1. The Code
12.4. Respond When the User Clicks a UI Element with the Mouse
12.4.1. Problem
12.4.2. Solution
12.4.3. How It Works
12.4.3.1. The Code
12.5. Respond When the User Clicks a UI Element in a Container with the Mouse
12.5.1. Problem
12.5.2. Solution
12.5.3. How It Works
12.5.3.1. The Code
12.6. Respond When the User Rotates the Mouse Wheel
12.6.1. Problem
12.6.2. Solution
12.6.3. How It Works
12.6.3.1. The Code
12.7. Drag Items from a List and Drop Them on a Canvas
12.7.1. Problem
12.7.2. Solution
12.7.3. How It Works
12.7.3.1. The Code
12.8. Handle Keyboard Events
12.8.1. Problem
12.8.2. Solution
12.8.3. How It Works
12.8.3.1. The Code
12.9. Query Keyboard State
12.9.1. Problem
12.9.2. Solution
12.9.3. How It Works
12.9.3.1. The Code
12.10. Suppress Keyboard and Mouse Events
12.10.1. Problem
12.10.2. Solution
12.10.3. How It Works
12.10.3.1. The Code
13. Migrating and Windows Forms Interoperability
13.1. Use WPF Windows in a Windows Forms Application
13.1.1. Problem
13.1.2. Solution
13.1.3. How It Works
13.1.3.1. The Code
13.2. Use WPF Controls in Windows Forms
13.2.1. Problem
13.2.2. Solution
13.2.3. How It Works
13.2.3.1. The Code
13.3. Use Windows Forms in a WPF Application
13.3.1. Problem
13.3.2. Solution
13.3.3. How It Works
13.3.3.1. The Code
13.4. Use Windows Forms Controls in a WPF Window
13.4.1. Problem
13.4.2. Solution
13.4.3. How It Works
13.4.3.1. The Code
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Copyright
Next
Next Chapter
About the Technical Reviewer
About the Authors
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset