JobaDiniz
JobaDiniz

Reputation: 1003

Understanding Shell, Conductor, Main Window concept in Caliburn.Micro

I'm having a hard time to grasp the Shell vs Main Window vs "which conductor to use" concept, even after reading the docs about Screen and Conductors.

Suppose I'm creating an app that has a menu toolbar that almost always will be visible (but not always).

(1) So, MetroWindow would be a Conductor.Collection.AllActive, because it will hold flyout/popup and the main container, and both can be activated at the same time?

(2) Also, the (1) would hold the screen which is activated from some event? (screen which will not have menu as I described earlier).

(3) Main container would be a Conductor.Collection.One, because it will hold the screens activated from menu, and only one can be activated at a time?

Am I in the right path? Any thoughts on this?

Upvotes: 2

Views: 958

Answers (1)

JobaDiniz
JobaDiniz

Reputation: 1003

Ok, I've figured it out.

ShellView is built with MetroWindow. ShellViewModel is a simple Conductor<IContainer>.

This viewmodel will manage flyouts as well which IContainer is current visible. Moreover, this viewmodel will manage any buttons that are in the Mahapps.metro titlebar.

Each IContainer could be any type of Conductor (Collection.One or Collection.AllActive). This way, an IContainer can either display a menu or not; it's entirely up to it.

To sum up and answer my own question:

  1. No. MetroWindow will be the ShellView, which has ShellViewModel, which inherits from Conductor.

  2. ShellViewModel will active any IContainer. So yes, when an event is raised, ShellViewModel will listen and active the appropriated viewmodel.

  3. No. There are no Main Container; only the ShellView.

Upvotes: 3

Related Questions