Using MVVM Light, Is it ok to store all the viewmodels in viewmodel locator?
public ViewModelLocator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
SimpleIoc.Default.Register<CoursesViewModel>(true);
SimpleIoc.Default.Register<EditCourseViewModel>(true);
//Many more viewmodels follow
}
Bearing in mind that there will potentially be many ( dozens ) of those alltogether? There is this great stackoverflow question "ViewModels in ViewModelLocator MVVM Light".
It received a great, detailed answer but the answer didn't actually 'answer' the question, i.e. to quote the author "Should I set DataContext in each page to View Model Property in ViewModelLocator or nest ViewModels as properties in MainVM and bind each page DataContext to Main.PhotosVMProperty, Main.DirectoriesVMProperty and so on?"
Thank you