views:

201

answers:

2

Just a simple question really, might be to simple really but hey here goes.

What makes WPF binding so powerful vs say Winforms databinding?

What are you likes and dislikes about it?

Any code example that show it's power would be cool.

+3  A: 

One of the powerful features of WPF data binding is that it can be two way, that changing target property in code change the value in binded control if property is dependency or implements INotifyPropertyChanged the other powerful feature is converters see WPF Two way databinding explained,Properties and data binding and the tired one that I think should be mentioned is that you can use WPF databinding with Animation classes

EDIT

So WPF databinding has this and many other features that is difficult to implement in winforms

  1. Can be two way
  2. Can be used in templates
  3. Can load data Async
  4. Can have Converter
  5. Can be binded directly to XML
  6. Can be used in Animation
ArsenMkrt
A: 

The power of WPF binding comes when you bind it to something other than a property on a POCO object.

For example, you can bind one controls enabled state to another controls checked state, like so:

<StackPanel>
    <CheckBox x:Name="cb" Content="Enable next section" />
    <Grid IsEnabled="{Binding ElementName=cb, Path=IsChecked}">
        <Button Content="Click Me!" />
    </Grid>
</StackPanel>
Cameron MacFarland