I want to make an ItemControl that provides some of its own children, and then when used can add additional children, similarly to the built in Expander class.
However, in this example, the Header TextBlock is also removed. This is a rephrasing of a question I asked yesterday (http://stackoverflow.com/questions/2277309/wpf-usercontrol-with-multiple-children).
LayerPanelItem.xaml:
<ItemsControl x:Class="Controls.LayerPanelItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<TextBlock>Header</TextBlock>
<StackPanel Name="InnerContent">
<!-- Test 1 and Test 2 should go here. -->
</StackPanel>
</StackPanel>
</ItemsControl>
Main.xaml:
<controls:LayerPanelItem>
<TextBlock>Test 1</TextBlock>
<TextBlock>Test 2</TextBlock>
</controls:LayerPanelItem>