Aside

WPF Data Binding can be divided into 3 categories:

  • Binding to control element
  • Binding to .NET object
  • Binding to XML data

Binding to Control Element

  • {Binding} : bind to current data context
  • {Binding Name} : bind to ‘Name’ property of current data context
  • {Binding ElementName=myTextBox Path=Text} : Bind to control element ‘myTextBox

Binding to .NET object

  • {Binding Source={StaticResource BookData} Path=Name} : Resources is the xaml window to .net Object, this example bind to BookDate.Name

Binding to XML

  • {Binding Source={StaticResource XMLDataSource} XPath=/books/book} : XML resources is the xaml window to XML object, this example bind to XMLDataSource.books.book instances

A good reference to understand WPF Data Binding – http://blogs.msdn.com/b/wpfsdk/archive/2006/10/19/wpf-basic-data-binding-faq.aspx

WPF Quick Programming Note 1: Data Binding

Advertisements

5 comments

  1. Unquestionably consider that which you stated. Your favorite
    justification appeared to be at the web the easiest thing to take
    into accout of. I say to you, I certainly get irked whilst folks
    think about concerns that they plainly don’t recognize about.

    You managed to hit the nail upon the top and also outlined out the entire
    thing with no need side effect , other folks can take a
    signal. Will likely be again to get more. Thank you

    Like


Leave a Reply

Fill in your details below or click an icon to log in:

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 )

Google+ photo

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

Connecting to %s