I want to achieve the following hierarchical navigation model in a WPF MVVM application:
ShellView
Page1View
Subpage1View
Subpage2View
Subpage3View
Page2View
...
Meaning that on Shellview, I have buttons to activate/deactivate Page1View and Page2View. On Page1View has buttons to activate Subpage1View and Subpage3View and Subpage1View has a button to activate Subpage2View.
Where should the subpages be displayed ? Should the navigational model map to a view structure exacly ? I mean, I have a ContentControl (named ActiveItem) on ShellView, where Page1View and Page2View is displayed when activated. Should the Subpage1View be displayed on Shell’s ActiveItem ContentControl or on the parent view (Page1View) ?
-
If I should display a subpage on ShellView, then how to activate it properly ? Because the button to activate it is on Page1View not on shell.
-
If I should display a subpage on the parent view (Page1View), then I must create a ActiveItem ContentControl on Page1View and hide it before it’s needed. How ? Also I guess parent view scrollbars could become a problem.
Please advise!
Using Caliburn.Micro 1.3, .NET 4, WPF.
Thanks!
I threw a demo together. I’m not sure if it’s exactly what you’re looking for. The thing to remember is
ScreensandConductorscan containScreensand/orConductors. So nesting or doing complex screen composition is pretty straight forward.This example has a
ShellViewwith 2 buttons and aContentControl.Page1ViewModelalso has 2 buttons and aContentControl.Clicking
Page1or thePage2button on theShellViewactivates the appropriatePage. The same is true once aPageis activated, clicking onSubPage1orSubPage2activates the appropriateSubPage.https://bitbucket.org/dbeattie/cmwpfnavsample/src