Have a few questions after doing some more work la...
# tornadofx
d
Have a few questions after doing some more work last night. 1. What is the best way to replace a view (that is not the main view of the scene)? If you have a sidebar where you can select different views and you show the view to the right? I found this piece, which works, but just wondering if there is a different way, or should I build a view around this to control the active view that is displayed?
find(ManageCategoriesView::class).replaceWith(ManageAccountsView::class, sizeToScene = true, centerOnScreen = true)
2. Is there a short hand for creating box in css? I often just need right padding...
box(0.px, 10.px, 0.px, 0.px)
Or color on 1 edge of a border
box(Color.Transparent, Color.Transparent, c("#333333"), Color.Transparent)
3. What is the lifetime of a ViewModel? What is the lifetime of a Controller? Do they exist forever as soon as they are injected at least one time? Can you be guaranteed that they will exist and keep state if you move to a view that doesn't use the ViewModel or Controller?