Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Windows Presentation Foundation

You're reading from   Mastering Windows Presentation Foundation Build responsive UIs for desktop applications with WPF

Arrow left icon
Product type Paperback
Published in Mar 2020
Publisher Packt
ISBN-13 9781838643416
Length 626 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sheridan Yuen Sheridan Yuen
Author Profile Icon Sheridan Yuen
Sheridan Yuen
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. A Smarter Way of Working with WPF 2. Debugging WPF Applications FREE CHAPTER 3. Writing Custom Application Frameworks 4. Becoming Proficient with Data Binding 5. Using the Right Controls for the Job 6. Adapting the Built-In Controls 7. Mastering Practical Animations 8. Creating Visually Appealing User Interfaces 9. Implementing Responsive Data Validation 10. Completing that Great User Experience 11. Improving Application Performance 12. Deploying Your Masterpiece Application 13. What Next? 14. Other Books You May Enjoy

Data binding basics

In WPF, we use the Binding class to create our bindings. In general, it is fair to say that every binding will contain four constituent parts. Let's take a look at them now:

  • The first is the binding source; typically, this will be one of our View Models.
  • The second is the path to the property from the source object that we would like to data bind to.
  • The third is the binding target; this will typically be a UI control.
  • The fourth is the path to the property of the binding target that we want to data bind to.

If one of our bindings does not work, it is most likely that one of these four things has not been set correctly.

It is important to stress that the target property will typically be from a UI control, because there is a data binding rule that states that the binding target must be a Dependency Property. The properties of most UI controls are Dependency Properties and so, this rule simply enforces that data normally travels in the direction from our View...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image