Switching main view with PRISM
Does anyone know of good tutorial how to switch what module is viewed in main region if i would have a win client that consist of 5 regions, Toolbar, Sidebar (with menu), footer and main regions.
I would want to have menu and when i pressed menuitem1 or me开发者_如何学编程nuitem1 it would load ModuleA og ModuleB in the main region.
this would be handled with PRISM off course
Sincerly Arnor
Look here for a complete run-through of the RegionManager. What you do, is make a ContentControl/UserControl in your shell that is assigned to be the the 'Main' region (using the attached RegionManager.Region property) - and then in your commands (behind the MenuItem1 and MenuItem2( you use the RegionManager to replace whatever is in the ContentControl with the new stuff.
If your region is set in an ItemsControl (or deriative) active Views will be placed one after another. In a ContentControl the last added will be Active and the rest InActive (you can switch with the Activate-method).
精彩评论