I have a tree of "demos", when a "demo" is selecte...
# tornadofx
I have a tree of "demos", when a "demo" is selected I want to show the corresponding
. Would the following class make sense as the model for the items in my tree:
Copy code
data class Demo(val title: String, val view: KClass<out UIComponent>)

class DemoModel : ItemViewModel<Demo>() {
    val title: StringProperty = bind { SimpleStringProperty(item?.title) }
    val view: ObjectProperty<KClass<out UIComponent>> = bind { SimpleObjectProperty<KClass<out UIComponent>>(item?.view) }
When a demo is selected in the tree I could then
to display the demo.