Caliburn binding to inner content controls

Topics: Conventions, Getting Started, UI Architecture
Dec 6, 2011 at 3:24 AM

I created a control which is hosting two content controls. I would like Caliburn to resolve the View/ViewModel for me but Caliburn ignores the hosted/inner ContentControls with the name SignalGenerator (see below). Any idea how to get around that problem?
<cc:HorizontalSplitterLayoutControl >

<cc:HorizontalSplitterLayoutControl.UpperContent>
<Label Content="Blockdiagram" />
</cc:HorizontalSplitterLayoutControl.UpperContent>

<cc:HorizontalSplitterLayoutControl.LowerContent>

<ContentControl x:Name="SignalGenerator"/>

</cc:HorizontalSplitterLayoutControl.LowerContent>
</cc:HorizontalSplitterLayoutControl>

Dec 6, 2011 at 7:31 AM

Caliburns AutoBinding Feature might not work for custom controls. If SignalGenerator is a property which exposes a ViewModel, you can bind it like that

<ContentControl View.Model="{Binding SignalGenerator}"/>

The view then gets automagically resolved