22. WPF Binding

In the last chapter we used the TemplateBinding markup extension to set values in a control template to the values of the public properties of the object. In general, “binding” simply means that the value of a property is retrieved from someplace else, and when you’re working in WPF, the dependency property system does most of the work for you. You tell WPF what you want it to do, either in XAML or code, and it handles the how.

Template bindings are a particular case of binding. WPF provides a general mechanism through the Binding object and the {Binding} markup extension. You can bind the value of a dependency property to any .NET object, and you can manipulate the binding in pretty much any way you need to.

In this chapter we’ll ...

Get Fluent C# 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.