Class DataBinding<TLayerProperty>
Namespace: Artemis.Core
Assembly: Artemis.Core.dll
Syntax
public class DataBinding<TLayerProperty> : IDataBinding, IStorageModel, IDisposable
  Type Parameters
| Name | Description | 
|---|---|
| TLayerProperty | 
Properties
BaseLayerProperty
Gets the layer property the data binding is applied to
Declaration
public ILayerProperty BaseLayerProperty { get; }
  Property Value
| Type | Description | 
|---|---|
| ILayerProperty | 
Entity
Gets the data binding entity this data binding uses for persistent storage
Declaration
public DataBindingEntity Entity { get; }
  Property Value
| Type | Description | 
|---|---|
| DataBindingEntity | 
IsEnabled
Gets a boolean indicating whether the data binding is enabled or not
Declaration
public bool IsEnabled { get; set; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
LayerProperty
Gets the layer property this data binding targets
Declaration
public LayerProperty<TLayerProperty> LayerProperty { get; }
  Property Value
| Type | Description | 
|---|---|
| LayerProperty<TLayerProperty> | 
Properties
Gets a list of sub-properties this data binding applies to
Declaration
public ReadOnlyCollection<IDataBindingProperty> Properties { get; }
  Property Value
| Type | Description | 
|---|---|
| ReadOnlyCollection<IDataBindingProperty> | 
Script
Gets the script used to populate the data binding
Declaration
public INodeScript Script { get; }
  Property Value
| Type | Description | 
|---|---|
| INodeScript | 
Methods
Apply()
Applies the pending value of the data binding to the property
Declaration
public void Apply()
  ClearDataBindingProperties()
Removes all data binding properties so they are no longer available to the data binding system
Declaration
public void ClearDataBindingProperties()
  Dispose()
Declaration
public void Dispose()
  Dispose(bool)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
  Parameters
| Type | Name | Description | 
|---|---|---|
| bool | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources.  | 
      
Load()
Loads the model from its associated entity
Declaration
public void Load()
  LoadNodeScript()
If the data binding is enabled, loads the node script for that data binding
Declaration
public void LoadNodeScript()
  OnDataBindingDisabled(DataBindingEventArgs)
Invokes the DataBindingDisabled event
Declaration
protected virtual void OnDataBindingDisabled(DataBindingEventArgs e)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBindingEventArgs | e | 
OnDataBindingEnabled(DataBindingEventArgs)
Invokes the DataBindingEnabled event
Declaration
protected virtual void OnDataBindingEnabled(DataBindingEventArgs e)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataBindingEventArgs | e | 
OnDataBindingPropertiesCleared()
Invokes the DataBindingPropertiesCleared event
Declaration
protected virtual void OnDataBindingPropertiesCleared()
  OnDataBindingPropertyRegistered()
Invokes the DataBindingPropertyRegistered event
Declaration
protected virtual void OnDataBindingPropertyRegistered()
  RegisterDataBindingProperty<TProperty>(Func<TProperty>, Action<TProperty?>, string)
Registers a data binding property so that is available to the data binding system
Declaration
public DataBindingProperty<TProperty> RegisterDataBindingProperty<TProperty>(Func<TProperty> getter, Action<TProperty?> setter, string displayName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Func<TProperty> | getter | The function to call to get the value of the property  | 
      
| Action<TProperty> | setter | The action to call to set the value of the property  | 
      
| string | displayName | The display name of the data binding property  | 
      
Returns
| Type | Description | 
|---|---|
| DataBindingProperty<TProperty> | 
Type Parameters
| Name | Description | 
|---|---|
| TProperty | The type of the layer property  | 
      
Save()
Saves the model to its associated entity
Declaration
public void Save()
  Update()
Updates the pending values of this data binding
Declaration
public void Update()
  Events
DataBindingDisabled
Occurs when a data binding has been disabled
Declaration
public event EventHandler<DataBindingEventArgs>? DataBindingDisabled
  Event Type
| Type | Description | 
|---|---|
| EventHandler<DataBindingEventArgs> | 
DataBindingEnabled
Occurs when a data binding has been enabled
Declaration
public event EventHandler<DataBindingEventArgs>? DataBindingEnabled
  Event Type
| Type | Description | 
|---|---|
| EventHandler<DataBindingEventArgs> | 
DataBindingPropertiesCleared
Occurs when all data binding properties have been removed
Declaration
public event EventHandler<DataBindingEventArgs>? DataBindingPropertiesCleared
  Event Type
| Type | Description | 
|---|---|
| EventHandler<DataBindingEventArgs> | 
DataBindingPropertyRegistered
Occurs when a data binding property has been added
Declaration
public event EventHandler<DataBindingEventArgs>? DataBindingPropertyRegistered
  Event Type
| Type | Description | 
|---|---|
| EventHandler<DataBindingEventArgs> |