DataBinding
Binding type that enables data synchronization between a property of a data source and a property of a VisualElement.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: Binding
- Implements: IDataSourceProvider
public class DataBinding : Binding, IDataSourceProvider
Constructors
Constructor | Description |
|---|---|
| DataBinding() | Initializes and returns an instance of DataBinding. |
Properties
Property | Description |
|---|---|
| bindingMode | Controls how this binding should be updated. The default value is BindingMode.TwoWay. |
| dataSource | Object that serves as a local source for the binding, and is particularly useful when the data source is not part of the UI hierarchy, such as a static localization table. If this object is null, the binding resolves the data source using its normal resolution method. |
| dataSourcePath | Path from the data source to the value. |
| dataSourceType | The possible data source types that can be assigned to the binding. |
| sourceToUiConverters | Returns the ConverterGroup used when trying to convert data from the data source to a UI property. |
| uiToSourceConverters | Returns the ConverterGroup used when trying to convert data from a UI property back to the data source. |
Methods
Method | Description |
|---|---|
| ApplyConverterGroupToSource | Applies a ConverterGroup to this binding that will be used when converting data between a UI control to a data source. |
| ApplyConverterGroupToUI | Applies a ConverterGroup to this binding that will be used when converting data between a data source to a UI control. |