After finishing some by-hand projects, my recent project implements the MVVM pattern using Caliburn.Micro - but I still struggle with some architectural problems. Mainly:
My ViewModel contains a BindableCollection
ProfilesCollection
of Profiles
. My view has a button to add new profiles. But since the profiles are complex I want the button click to open a new window where I can fill in the details, and then return back to the main window.
In my previous by hand approach I made the ProfilesCollection
static so that it was accessible throughout the whole application, and as click event I just opened a new window, where I then stored the new profile in the static Collection
.
What would be the right MVVM approach? Create a new view/ viewmodel instead of a new window? How do I manage them, and how do I pass the Profile
I create back to the MainViewModel?
Thanks!