February 17, 2012

WPF/Silverlight Data Binding

WPF Basic Data Binding FAQ - Better explanation than the one below.

WPF Data binding cheat sheet

Data Binding Overview - Basically, the target is the control and the source is the code property. Typically, each binding has these four components: a binding target object, a target property, a binding source, and a path to the value in the binding source to use. For example, if you want to bind the content of a TextBox to the Name property of an Employee object, your target object is the TextBox, the target property is the Text property, the value to use is Name, and the source object is the Employee object.

http://msdn.microsoft.com/en-gb/magazine/cc163299.aspx - Data Binding in WPF. Good introduction. Good short description of Xml data binding (though not 2 way I notice)

http://msdn.microsoft.com/en-us/magazine/cc700358.aspx - Customize Data Display with Data Binding and WPF. Some good stuff on hierarchical data templates and how to use them to fill a tree view using object data binding.

http://www.codeproject.com/Articles/26270/Understanding-WPF-via-ASP-NET - Nice article comparing WPF and ASP.NET data binding etc.

Also look at these related blogs
Data Templates

Bind "IsEnabled" of one control "cbXXX" to "IsChecked" property of another with name "cbYYY" in Xaml:
... Name="cbXXX" IsEnabled="{Binding ElementName=cbYYY, Path=IsChecked}" ...

No comments: