O'Reilly logo

Illustrated WPF by Daniel Solis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Data Binding

What Is Data Binding?

Oftentimes a visual element displays the representation of some underlying data value. In this case, you usually want to ensure that the visual element stays up-to-date and changes when the underlying data value changes.

For example, consider a window that contains two elements—a TextBox at the top and a Slider control beneath it. You'd like to have the TextBox represent the value of the Slider such that when you move the Slider back and forth, the value in the TextBox changes to show the Slider's current value. This is illustrated in Figure 8-1, which shows the window in three different states.

The value displayed in the TextBox is bound to the current value of the Slider.

Figure 8.1. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required