Saturday, June 5, 2010

Data binding in WPF


Binding is class which is used for data binding in WPF. Binding class has below important property which you can use for data binding in WPF.
  • ElementName : Name of element to which you want to bind
  • FallbackValue: It is used when binding is unavailable. You can say default value. Like if you have set binding to one element’s “ABC” property but if class does not contain “ABC” property then it will use FallbackValue.
  • Mode: It defines the mode of data binding.
  • NotifyOnSourceUpdated: It specifies whether we need to fire event sourceupdated when value is transferred from target to source.
  • NotifyOnTargetUpdated: It specifies whether we need to fire event sourceupdated when value is transferred from source to target.
  • Path: It specify property name with which we need to bind data.
  • XPath: specifies XPath query which will be used when retrieving value from XML.
  • Source: It specify object which we need to bind.
  • RelativeSource: Specify binding’s location relative source. If you want to bind control by using visual tree then you can specify relative source of binding.
Data binding with different type.




No comments: