Yes I understand that paying customers have more priority.
Its only not understandable for me why delete GetViewModelInstance bevor the CustomViewModelFactory is tested.
To the IViewModelLocator.
I have two views DetailView and GeneralView and One ViewModel.
But i have a lots of Instances of this views and viewmodel.
So it depends on the model if a new viewmodel should be created or a existing viewmodel should be used.
Thats my code in View:
protected override IViewModel GetViewModelInstance(object dataContext)
if (dataContext is PlaceInstance)
var model = dataContext as PlaceInstance;
var manager = ServiceLocator.Default.ResolveType<IViewModelManager>();
var vm = manager.GetViewModelsOfModel(model).SingleOrDefault();
Thats also easy to handle in ViewModelFactory. But how to handle in ViewModelLocator??