Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

22. WPF Binding

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 explore the basic concepts of WPF binding: the source of the value, the target that receives the value, and the Binding and View objects that link them. We’ll also look at binding sets of items to an items control and some of the techniques you can use to format and navigate a set of items.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint