The problem was in a place that I never expected ... Debugging the navigation API led me to RegionNavigationContentLoader
public object LoadContent(IRegion region, NavigationContext navigationContext)
When I stepped further along the code, I turned to:
protected virtual IEnumerable<object> GetCandidatesFromRegion( IRegion region, string candidateNavigationContract)
I noticed that naming here is key to matching the view with the view model.
In my example, the name for each part was:
public class SiteDetailsViewModel { ... }
When I accidentally made the following change:
ViewName.SiteView = "SiteDetailsView"
Work everthing.
Conclusion
The name of the ViewModel must begin with the same name with which you indicate your opinion.
I checked this by changing my view to:
public class MyView { ... }
and still use the same view name to register in the container and navigate:
_container.RegisterType<object, MyView>(ViewNames.SiteView); ... _regionManager.RequestNavigate(RegionNames.DetailRegion, ViewNames.SiteView + "?ID=" + site.ID);
This also works. Thus, it seems that the name of the View-Model is associated with the name of the view used to jump to this view.
Note
This is only when you use IoC and Unity with the PRISM 4 API. This is not like using MEF.
Further research
I also know that some tips told us to use typeof(MyView).FullName when registering a view with a container ...
_container.RegisterType<object, MyView>(typeof(MyView).FullName);
I personally think this is a mistake. Using the full name of the view, you create dependencies between the view and anyone who wants to go to that view ...
_regionManager.RequestNavigate(RegionNames.DetailRegion, typeof(MyView).FullName + "?ID=" + site.ID);