D2 SIG Meeting – 07/07/2009 – Recap

d2siglogo

I attended the July D2 SIG Meeting this passed Tuesday.  Claudio Lassala was speaking on the topic of Data Binding in WPF.  Pretty good turnout of 30-35 people, especially since this is a fairly new group.

Claudio’s Information

High-level Presentation Summary

WPF – Windows Presentation Foundation – WikiPedia defines a WPF as graphical subsystem for rendering user interfaces in Windows-based applications.

XAML – Extensible Application Markup Language – The declarative language behind WPF

The simple concept of data binding is relating two objects and saying when one changes, so does the other.

Objects involved in Data Binding

  • Target – TextBox, ComboBox,etc
  • Source – Customer object

Binding Modes in WPF

  • OneWay – reads the information from the source and populates the target TextBox.
  • TwoWay – reads the information from the source and populates the target TextBox, but if the TextBox is changed, it updates the source Customer Object. This needs notification through a DependencyObject or INotifyPropertyChanged.
  • OneWayToSource – sends data from the target to the source.

Types of Binding

  • XAML Binding
  • Programmatic Binding

Bindings can be removed using BindingOperations.ClearBinding() method

Relative Sources

  • Self, TemplatedParent, FindAncestor, PreviousData
  • Value Converters can convert values during the process of binding.
  • Data Validation
  • Data Templates

Some of the examples Claudio went over included

  • Binding an image control to a byte array
  • ListBox
  • Validation Rules
  • Simple Binding from Blend
  • TwoWay Notification
  • Rating to Color Converter
  • XML Data Provider

Presentation Slides and Demo Code

Claudio does a great job of showing you how you should not code something then following by how you should.

Until next time…

Posted on July 12, 2009, in Community, WPF, XAML. Bookmark the permalink. Leave a Comment.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.