I load my modules in the bootstrapper with:
protected override IModuleCatalog CreateModuleCatalog()
{
var moduleCatalog = new DirectoryModuleCatalog();
moduleCatalog.ModulePath = @".\Modules";
return moduleCatalog;
}
which works fine when the project of the modules are referenced in the shell project. The correct ViewModels will be injected by the following attached property.
<UserControl prism:ViewModelLocator.AutoWireViewModel="True" [..]</>
Unless I remove the project reference the ViewModels will not be set anymore by the prism:ViewModelLocator.AutoWireViewModel="True".
Does anybody know the what causes that? You can watch this behaviour on the project https://github.com/mfe-/Get.the.solution.Prism.Demo . How can I fix this?
if (assembly.GetTypes().Where(x => x.FullName == viewModelName).Count() > 0)
before linevar type = assembly.GetType(viewModelName, true);
because its not necessary to have ViewModel for every View. – Li