ViewModels references in ShellViewModel Caliburn.Micro
<p>In this thread : <a href="https://stackoverflow.com/questions/20607168/can-anybody-provide-any-simple-working-example-of-the-conductort-collection-al/37881531#37881531">Can anybody provide any simple working example of the Conductor&lt;T&gt;.Collection.AllActive usage?</a> I've had part of an answer but I'm still a but confused. </p>

<p>I would simply like to reference all my view models into my ShellViewModel to be able to open/close ContentControls, but without injecting all of them in the constructor.</p>

<p>In the answer, it is suggested to inject an interface in the constructor of the ShellViewModel. If I do that, do I have to inject all my ViewModels in a class that implements that interface?</p>

<pre><code>public MyViewModel(IMagicViewModelFactory factory)
{
    FirstSubViewModel = factory.MagicallyGiveMeTheViewModelIWant();
    SecondSubViewModel = factory.MagicallyGiveMeTheViewModelIWant();
    ThirdSubViewModel = factory.MagicallyGiveMeTheViewModelIWant();

    Items.Add(FirstSubViewModel);
    Items.Add(SecondSubViewModel);
    Items.Add(ThirdSubViewModel);
}
</code></pre>

<p>Also, I would like to avoid going through IoC.Get&lt;> to get the instances of my view Models, I think it violates the principles of IoC if I am not mistaken. 
In a few other examples, they create new viewModels when needed, but what's the point of using IoC in that case, especially when I need services injected inside those new ViewModels?</p>

<p>In my Shell view, I have a layout with 3 different areas, bound to my shell view model by : </p>

<pre><code> &lt;ContentControl x:Name="Header"
                    Grid.ColumnSpan="3"/&gt;
 &lt;ContentControl x:Name="Menu"
                    Grid.Row="1"/&gt;
 &lt;ContentControl x:Name="Main"
                    Grid.ColumnSpan="3"/&gt;
</code></pre>

<p>In my ShellViewModel extending Conductor.Collection.AllActive, I reference the 3 areas like this: </p>

<pre><code>public Screen Menu { get; private set; }
public Screen Header { get; private set; }
public Screen Main { get; private set; }
</code></pre>

<p>I would like to be able to change them like so: </p>

<pre><code>Menu = Items.FirstOrDefault(x =&gt; x.DisplayName == "Menu");
Header = Items.FirstOrDefault(x =&gt; x.DisplayName == "Header");
Main = Items.FirstOrDefault(x =&gt; x.DisplayName == "Landing");
</code></pre>

<p>All my ViewModels have a DisplayName set in their constructor.</p>

<p>I have tried this but GetChildren() is empty</p>

<pre><code>foreach (var screen in GetChildren())
        {
            Items.Add(screen);
        }
</code></pre>

<p>Am I missing something obvious? </p>

<p>Thanks in Advance! </p>