edvin
10/12/2016, 9:30 PMcontentLabel.toggleClass
line should be outside the itemProperty.onChange
- it doesn't need to be reapplied when the item changes. I think the TornadoFX ViewModel is not very well suited for mediating between Views in it's current implementation actually. Right now a better word for it would probably be EditModel
, since it doesn't observe changes to the properties it wraps, and that it needs a commit to happen for changes to be pushed back to the underlying object. This use case would be easier solved with a more direct view model. I will create an example and show you what I mean tomorrow. Wow, this little app has made me realize a lot of shortcomings for the ViewModel. It might just need an immediate
mode though. Will be looking at that tomorrow as well.