Only show shell when fully populated with modules

Topics: Prism v2 - WPF 3.5
Oct 30, 2009 at 9:19 AM

Is there a way to delay the showing of the shell until after all modules have been loaded into the regions.

I noticed on slow computers you see the shell then each module loading which is not so nice.

Oct 30, 2009 at 6:28 PM

I use the following scheme:

I have 3 modules in my app (Authorization, Orders, Reporting) - Authorization is marked as WhenAvailable, the others are OnDemand.  My Shell has its Visibility set to collapsed.

My Authorization module shows a login screen.  When the user is authenticated, it raises an event which calls LoadModule on the other modules.  The calls to LoadModule block, so after they all complete I set the Visibility of the shell to Visible.

When the Vibility property is changed, I also begin a Storyboard that performs some animations in the Shell.  When that storyboard is complete, I raise another event (ShellReady) that allows for some other logic to run, like opening some views, etc.

Hope that helps.