"The view model of the view 'CatelValidation.DetailView' could not be resolved.

Topics: Questions
Jun 17, 2014 at 7:44 AM
Edited Jun 17, 2014 at 7:52 AM
Hello.

I try to fix the issue : "https://catelproject.atlassian.net/browse/CTL-395?filter=-2"
And open the repro with the newest catel.
And I have the next problem.

In the repro the ViewModel is located in the View.
protected override Type GetViewModelType()
{
    return typeof(DetailViewModel);
}
For catel 4.0 I deleted this code in the codebehind of view.

I thougt the ViewModelLocator can automatical locate this viewmodel

Name of View: DetailView
Name of ViewModel: DetailViewModel.
  1. Files in the Same Folder
    -> Viewmodel Could not resolved
  2. ViewModel in Folder ViewModel
    -> Viewmodel Could not resolved
  3. ViewModel in Folder ViewModel
    View in Folder View
    -> Viewmodel Could not resolved
??
Jun 17, 2014 at 9:21 AM
The folders don't matter in Catel, because in compiled assemblies, folders only exist for resources. It's the namespaces that matter, so if you have MyApp.Views.DetailView, you should have MyApp.ViewModels.DetailViewModel.
Jun 17, 2014 at 12:22 PM
You're right. I moved it to folders bot forget to change the namespace.
Jun 17, 2014 at 12:50 PM
Next problem. No chance to get the repro to work.

TypeNotRegisteredException:
Catel.Data.IModelEqualityComparer is not registered. Do I missed something again?
Jun 17, 2014 at 2:55 PM
That's weird. It is registered in CoreModule, which is called as soon as the assembly is referenced / being used for the first time.
Jun 17, 2014 at 3:19 PM
Its realy weird. I debuged in the CoreModule and now it works. I don't know if I changed everything else.
Maybe I have to download the repro again.