Data source binding source.
DataSourceBindingSource specifies a path to a data source in the local effective data source context. When the value specified by the path changes, it is used as the source value for the binding. If the data object specified by the path is not available, DataSourceBindingSource waits for the object to be available and connects when it exists for the local data source context.
Creating a data source binding source
To create a data source binding source:
Writing to data sources with bindings
To write to a data source, you can create a two-way binding to a data source.
BindingSourcePtr source = DataSourceBindingSource::create(
"cluster.speed.needle.rotationAngle");
BindingRuntimeHandle runtime = node->setBinding(binding, Node2D::RenderTransformationProperty, PropertyFieldRotationZ);
Considerations
Data source binding sources can connect and read values only if a data source is available for the location in which they are used. For nodes this means that the DataContext::DataContextProperty is set in the node or in an ascendant of the node.
You can create a data source binding by binding to the DataContext::DataContextProperty of a Node. In this case, a DataObject within the DataContext can serve as the data source for the Node and its descendants. To create a data context binding:
BindingRuntimeHandle runtime = node->setBinding(binding, DataContext::DataContextProperty);
- Since
- Kanzi 3.7.0