views:

120

answers:

2

As far as I know, INotifyPropertyChanges was "invented" before WPF. Could someone please explain what is new in WPF that allowed to do different kinds of binding properties of the control to the properties of objects.

Either this was also available in the WinForms but wasn't so popular due to some reasons? (if yes, what is that reasons)?

Thanks.

+3  A: 

In WPF, you can bind not only to objects implementing INotifyPropertyChanged, but also to dependency objects exposing dependency properties, which are much more flexible than regular properties.

There are also new interfaces for collections :

  • INotifyCollectionChanged, which allows collections to send notifications when items are added, deleted or replaced
  • ICollectionView, which defines how a collection is presented to the UI

The WPF binding mechanism is also much more flexible than the Windows Forms bindings... In Windows Forms, you could only say : Bind property X of object A to property Y of object B. There was no DataContext, so you couldn't define relative bindings. You couldn't use complex property paths (e.g. A.X.Items[foo].Bar). All conversions had to be done in event handlers rather than in reusable converters. Bindings could only be defined on controls, whereas in WPF any DependencyObject can use bindings. And so on...

Thomas Levesque
A: 

I agree with Thomas. Also i would like to add that in WPF binding, you can set the mode of the binding viz :

http://msdn.microsoft.com/en-us/library/system.windows.data.bindingmode.aspx

saraf uddin