Chapter 3
Data Binding in WPF
IN THIS CHAPTER
Understanding dependency properties
Working with binding modes
Defining an example binding object
Making sense out of data
Data binding allows data from your application objects (the binding source) to be displayed in your user-interface elements (the binding target). What this means is that you can bind the Text
property of a TextBox
(for example) to the Name
property of an instance of your Car
class. Depending on the binding mode used when setting up the relationship, changes in the Text
property value of the TextBox
can automatically update the underlying Name
property of your Car
object (and vice versa) without requiring any additional code.
It's no mystery these days that most applications deal with data. As a WPF developer, you have full creative reign on how data is presented and how information entered by your user can be validated and used to update your underlying objects. One of WPF's strengths is its rich data binding support. This chapter walks you through the details.
Get C# 10.0 All-in-One For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.