bidirectionalBind

This property's value is set to other's value, and then both values are bound to each other. i.e. if either property changes, the other will also change.

NOTE. Unlike bindTo, a bidirectional bind only uses weak references, and therefore if this bind is the last reference to Property other, then other will be garbage collected, so bidirectional binds cannot lead to memory leaks.

Throws

If a bidirectional bind already exists between the two properties.


open fun <B> bidirectionalBind(other: Property<B>, converter: Converter<V, B>): BidirectionalBind

This property's value is set to other's value, and then both values are bound to each other. i.e. if either property changes, the other will also change.

converter is used to convert this Property's value to a value suitable for property other and vice-versa. For example, if this property is a ratio in the range 0..1, then we could bind it to a percentage property. The forward direction of the converter would multiply by 100, and the backward direction would divide by 100.

The types of this Property's value and other Property's value do not have to be the same. e.g. we could use a converter which uses Int.toString() in the forward direction, and String.parseInt() in the backward direction.

NOTE. Unlike bindTo, a bidirectional bind only uses weak references, and therefore if this bind is the last reference to Property other, then other will be garbage collected. Bidirectional binds cannot lead to memory leaks.

Throws

If a bidirectional bind already exists between the two properties.