bind property

({GraphObject Function(Binding binding) $1, GraphObject Function([String? targetprop, String? sourceprop, TargetConversion? conv, BackConversion? backconv]) $2}) get bind

Overload accessor: $1, $2

Implementation

({
  /// Add a data-binding of a property on this GraphObject to a property on a data object.
  ///
  ///  Do not add, modify, or remove any Bindings after this object has been copied.
  ///
  ///  An example using `.bind` with the Binding argument:
  ///
  ///  ```js
  ///  myDiagram.nodeTemplate =
  ///    new go.Part("Horizontal")
  ///     .bind(new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify))
  ///     // ...
  ///  ```
  ///
  ///  Read more about Bindings at <a href="../../intro/dataBinding.html">the Introduction page about Data Bindings</a>.
  ///  @param {Binding} binding
  ///  @return {GraphObject} this GraphObject
  _i3.GraphObject Function(_i3.Binding binding) $1,

  /// Add a data-binding to this GraphObject for the given property names and optional conversion function.
  ///
  ///  Do not add, modify, or remove any Bindings after this object has been copied.
  ///
  ///  An example using `.bind` with the shorthand arguments:
  ///
  ///  ```js
  ///  myDiagram.nodeTemplate =
  ///    new go.Node("Horizontal")
  ///     .bind("location", "loc")
  ///     // ... rest of Node template
  ///  ```
  ///
  ///  An example using both shorthand and a new go.Binding with `.bind`:
  ///
  ///  ```js
  ///  new go.Shape({
  ///      // ... shape properties
  ///    })
  ///    // Shape.fill is bound to Node.data.color
  ///    .bind("fill", "color")
  ///    // Shape.stroke is red when Node.isHighlighted is true, black otherwise
  ///    .bind(new go.Binding("stroke", "isHighlighted",
  ///                  h => return h ? "red" : "black").ofObject())
  ///  ```
  ///
  ///  If you need to call Binding#makeTwoWay or Binding#ofObject, you will have to use a `new go.Binding()` as
  ///  the argument to this method.
  ///
  ///  Read more about Bindings at <a href="../../intro/dataBinding.html">the Introduction page about Data Bindings</a>.
  ///
  ///  @param {string=} targetprop A string naming the target property on the target object.
  ///    This should not be the empty string.
  ///  @param {string=} sourceprop A string naming the source property on the bound data object.
  ///    If this is the empty string, the whole Panel#data object is used.
  ///    If this argument is not supplied, the source property is assumed to be the same as the target property.
  ///  @param {TargetConversion} conv An optional side-effect-free function converting the data property value to the value to set the target property.
  ///    If the function is null or not supplied, no conversion takes place.
  ///  @param {BackConversion} backconv An optional conversion function to convert property values back to data values.
  ///  Specifying this modifies the binding to set its Binding#mode to be Binding.TwoWay.
  ///  If you want a two-way binding without a back-conversion function, call this method with the new Binding
  ///  argument instead, and call Binding#makeTwoWay on it: `.bind(new go.Binding(...).makeTwoWay())`
  ///  @return {GraphObject} this GraphObject
  ///  @since 2.2
  _i3.GraphObject Function([
    _i2.String? targetprop,
    _i2.String? sourceprop,
    _i3.TargetConversion? conv,
    _i3.BackConversion? backconv,
  ]) $2,
}) get bind => (
      $1: _bind$1,
      $2: _bind$2,
    );