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
6
votes
2 answers

Cannot find the GETTER for attribute 'app:vm' with value type Boolean

I'm trying to use native 2-way android data binding in my custom control so I have something like that in xml ... ... Please note, it's…
6
votes
3 answers

WCF Data Contracts DTO

In my application I am making a service call and getting back populated WCF Data Contract object. I have to display this data in a grid. Is it good practice to bind the data contract to the grid ? Josh
Josh
  • 249
  • 3
  • 11
6
votes
4 answers

Where is IsSynchronizedWithCurrentItem property (or equivalent) for a TreeView?

Tell me it ain't so. I have a typical windows/file explorer like setup. Left Side I have a TreeView all data bound showing nodes in a hierachy Right Side I have a ListView showing Node.Properties ListView has a IsSynchronizedWithCurrentItem…
Gishu
  • 134,492
  • 47
  • 225
  • 308
6
votes
1 answer

Multiple Combobox with same Itemsource but the SelectedItem should be different - WPF

Goal is to have multiple Combobox, once the item is selected in any of the Combobox, it should be removed or hided from other Comboboxes for selection. I'm able to change the source whenever the selection got changed on any of the Comboboxes. But…
Gopichandar
  • 2,742
  • 2
  • 24
  • 54
6
votes
2 answers

WPF - Bind ComboBox Item Foreground to Its Value

I created a ComboBox listing the colors that System.Windows.Media.Colors predefines, using the approach told in this question: How can I list colors in WPF with XAML? My XAML code now is:
VincentZHANG
  • 757
  • 1
  • 13
  • 31
6
votes
2 answers

XAML Data Binding not updating UI when property changes

I'm having trouble getting a simple data bound label to update when an integer field is changed. I've implemented INotifyPropertChanged and this event gets fired when I chang my variables value. The UI does not update and the label does not change.…
Timothy
  • 135
  • 1
  • 9
6
votes
1 answer

How to bind an ObservableCollection to a WrapPanel?

I'm using WPF. I have ObservableCollection of ToggleButton : private ObservableCollection myg = new ObservableCollection(); and I want to bind these ObservableCollection controls(ToggleButtons) as WrapPanel childrens.…
armandasalmd
  • 169
  • 3
  • 10
6
votes
3 answers

angular2 data binding between service and component properties

I need some clarification on binding between service and component properties and data binding in angular2 assume i have a service(singleton) and a component export class Service { name = "Luke"; object = {id:1}; getName(){return this.name}; …
Han Che
  • 8,239
  • 19
  • 70
  • 116
6
votes
2 answers

Any default converters for WPF?

i read that i can use data converters in binding like ... from here but i wonder if there are any "in-built" converters. because creating converters to just output say 2…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
6
votes
2 answers

How to handle ObservableCollection<> result from a parallelized Task in MVVM?

I am gathering data in a separate Task and I want to data bind the result to a GUI component using an ObservableCollection<>. So my code goes something like this: private ObservableCollection _items; public ObservableCollection
Magnus Johansson
  • 28,010
  • 19
  • 106
  • 164
6
votes
0 answers

Bindingsource calling controls' value property multiple times?

I have a simple DTO class which I set as the datasource of a bindingsource on a form. The form contains a custom control with a Value property. This is the property: [Browsable(false)] [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] public…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
6
votes
1 answer

How to test MVVM with DataBinding on Android

I been searching online but I'm unable to find out how testing is made better with MVVM. I get the idea of having a viewModel which interfaces with the view but I don't know how I would write good test cases with MVVM. I have the following ViewModel…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
6
votes
1 answer

Android gradle-experimental with databinding not working?

I had some troubles when I tried to use the latest Android building tool(gradle-experimental:0.6.0-alpha3) with databinding framework. It results in an error when I try to refresh all gradle projects. First: Error:Exception thrown while executing…
bitdancer
  • 1,215
  • 2
  • 19
  • 34
6
votes
4 answers

Cross-thread operation exception when worker thread adds to BindingList

I have a worker thread that needs to add items to a BindingList. However, the BindingList is databound to a DataGridView. So, when I try to add to the list, I get an InvalidOperationException (Cross-thread operation not valid: Control accessed from…
C Walker
  • 793
  • 2
  • 9
  • 19
6
votes
2 answers

Simple DataBinding

I am trying to make a (very) simple Data Binding test, but it doesn't work as I expected... Say I have the following classes: // this class represents some kind of data producer public class DataSourceClass { public string Data { get;…
ET.
  • 1,899
  • 2
  • 18
  • 28