/** * Bind the selectedValueProperty of this toggle group to the given property. Passing in a writeable value * will result in a bidirectional binding, while passing in a read only value will result in a unidirectional binding. * * If the toggles are configured with the value parameter (@see #togglebutton and #radiogroup), the corresponding * button will be selected when the value is changed. Likewise, if the selected toggle is changed, * the property value will be updated if it is writeable. */ fun ToggleGroup.bind(property: ObservableValue) = with(selectedValueProperty()) { if (property is Property<*>) bindBidirectional(property as Property) else bind(property) }