Questions tagged [data-binding]

A general technique that binds two data/information sources together and maintains them in sync.

Data binding is a general technique that binds two data/information sources together and maintains them in sync. This is usually done with two data/information sources with different types as in data binding. However, in UI data binding, data and information objects of the same type are bound together (e.g. objects to Java UI elements).

If the binding has been made in the proper manner, then, each data change is reflected automatically by the elements that are bound to the data. The term data binding is also used in case where an outer representation of data in an element changes, and the underlying data is automatically updated to reflect this change. As an example, a change in a TextBox element could modify the underlying data value.

Ref:

WPF DataBinding: Windows Presentation Foundation () data binding provides a simple and consistent way for applications to present and interact with data. Elements can be bound to data from a variety of data sources in the form of common language runtime () objects and XML.

23688 questions
128
votes
4 answers

Android : Difference between DataBinding and ViewBinding

We are using DataBinding since Jetpack release. Android documentation indicates that ViewBinding was added in Android Studio 3.6 Canary 11+. I read the documentation but its looks similar to DataBinding. Can anyone explain what's the difference…
128
votes
8 answers

How do I bind a WPF DataGrid to a variable number of columns?

My WPF application generates sets of data which may have a different number of columns each time. Included in the output is a description of each column that will be used to apply formatting. A simplified version of the output might be something…
Generic Error
  • 4,437
  • 6
  • 28
  • 26
124
votes
7 answers

Access parent DataContext from DataTemplate

I have a ListBox which binds to a child collection on a ViewModel. The listbox items are styled in a DataTemplate based on a property on the parent ViewModel: