In MVVM,
Who creates the first and subsequent views, view models, and models?
Who displays the views?
And who decides which views and which models connect to which view model?
It feels to me like there is always going to be some code/XML/configuration/etc. -- some "connecting tissue", so to speak -- that doesn't fit into any of the Model, View Model, or Model components.
MVVM
is a pattern for decoupling UI from code. It's not for building entire application only with these 3 types of classes (view,viewmodel,model). You can still have factories, bootstrappers, repositories, etc.
Caliburn.Micro
first view is created in class
Bootstrapper
with DisplayViewFor<MainViewModel>
Views
and
matches them with ViewModels
.Class1View
is connected to Class1ViewModel
.
Models are usually passed via constructor.Note that I base my knowledge mostly on how Caliburn.Micro
does it, but I suspect that it isn't very different from what other frameworks do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With