Prism V4 / Navigation + Sub-Regions (WPF 4)

Topics: Prism v4 - WPF 4
Oct 30, 2011 at 5:41 PM
Edited Oct 30, 2011 at 5:52 PM

Hi

I’m using the Navigation framework and I reached a point where I need to toggle between multiple views within a single screen. It seems more appropriate to use SubRegions as opposed to toggling between UserControls (in theory :)

Has anyone faced such scenario and kind to share some possible pitfalls?

I already noticed that the RegionContext can be bound only to Controls in the host region (e.g Dependency Property sources) and I think I can live with that. 

However, my concern is about how SubRegions play with the Navigation Infrastructure

(e.g RequestNavigate(RegionNames.SubRegion … ??)

Thanks,

-Itai

Oct 31, 2011 at 4:40 AM

Yes. Subregion navigations works the same way. You can pass parameters to your sub views using the query parameters, if you are no comfortable using RegionContext.

Nov 1, 2011 at 1:32 AM

Thanks! I'll give it a try.

Nov 1, 2011 at 10:35 AM

Hmm.. didn’t work for me.

I registered the sub views in the container (like the other views), and put the designated sub region content control within the hosting view.

_RegionManager.RequestNavigate(RegionNames.SubContentRegion, "MySubView", (x) => { return; });   resulted in "System.Object" being displayed, so it appears that the hosting region is not created automatically..

Is this the correct usage?

Thanks,

-Itai