Notice that this is using the new property syntax....
# tornadofx
e
Notice that this is using the new property syntax. The first two lines of code gives you: - An observable
Property<User>
called
userProperty
with a default value of an empty
User
- Getters and setters so you can do
model.user = User()
and
val user = model.user
In the
init
block we tell the
ViewModel
to automatically rollback any changes when the user object is changed, which will in turn update an input fields that are bound to the
ViewModel
.