package com.example.demo.app import javafx.beans.property.SimpleIntegerProperty import tornadofx.* class Thing(n: Int) { val x = SimpleIntegerProperty(n) private val x2 = integerBinding(x) { value * 2 } val x2Property = SimpleIntegerProperty() init { x2Property.bind(x2) } } class ThingModel(thing: Thing? = null) : ItemViewModel(thing) { val x = bind(Thing::x) val x2p = bind(Thing::x2Property) } class MainView : View() { val thing1 = Thing(1) override val root = vbox { label(thing1.x2Property) button("Bump") { action { val model = ThingModel(thing1) model.x.value = 2 model.commit() } } } } class MyApp : App(MainView::class)