

Observable property that will be bound to other observable(s). Type parameters K Parameters bindProperty Type parameters K1 K2 Parameters bindProperty1 The bind chain with the to() and toMany() methods. Observable properties that will be bound to other observable(s). ( isAEnabled, isBEnabled, isCEnabled ) => isAEnabled & isBEnabled & isCEnabled ) Must be enabled for the button to become enabled, use the following code: button.bind( 'isEnabled' ).toMany(, 'isEnabled', To bind a button to multiple commands (also Observables) so that each and every one of them

It is also possible to bind to the same property in an array of observables.

Using a custom callback allows processing the value before passing it to the target property: button.bind( 'isEnabled' ).to( command, 'value', value => value = 'heading1' ) ( isCommandEnabled, isUIVisible ) => isCommandEnabled & isUIVisible ) The binding can include more than one observable, combining multiple data sources in a custom callback: button.bind( 'isEnabled' ).to( command, 'isEnabled', ui, 'isVisible', Which corresponds to: button.bind( 'isEnabled' ).to( command ) It is possible to bind more than one property at a time to shorten the code: button.bind( 'isEnabled', 'value' ).to( command ) You can also "rename" the property in the binding by specifying the new name in the to() chain: button.bind( 'isEnabled' ).to( command, 'isWorking' ) Note: To release the binding, use unbind. whenever command.isEnabled changes, button.isEnabled will immediately reflect its value.button.isEnabled instantly equals command.isEnabled,.Or even shorter: button.bind( 'isEnabled' ).to( command ) Binds observable properties to other objects implementing theĬovering the topic of property bindings with some additional examples.Ĭonsider two objects: a button and an associated command (both Observable).Ī simple property binding could be as follows: button.bind( 'isEnabled' ).to( command, 'isEnabled' )
