When you navigate to a view or view model using a URI, the view is created through the use of MEF. In order for the SubViewModel to be exported correctly, you need to have added the assembly in which it is contained to the Aggregate Catalog. You could add
something like this to the MainBootstrapper class to achieve what I'm saying:
protected override void ConfigureAggregateCatalog()
Additionally, due to a timing issue, when you call this line:
RegionManager.RequestNavigate("SubRegion", new Uri("SubViewModel", UriKind.Relative));
The SubRegion will not have been created yet. So you could replace that line by this one:
this.ViewRegistry.RegisterViewWithRegion("SubRegion", () => ServiceLocator.Current.GetInstance<SubViewModel>("SubViewModel"));
That way, the SubViewModel will be added to the SubRegion when the region is actually created.
I hope you find this helpful.
Guido Leandro Maliandi