I have a UserControl that I would like to have more than one child. It already has a StackPanel as it is a child, so what am I doing wrong?
Ultimately, I would like the control to automatically include some of its own children, and then, when used, allows more children to be placed inside one of its elements. I tried MSDN How to redefine a logical tree without success.
Thanks in advance.
LayerPanelItem.xaml:
<UserControl x:Class="Controls.LayerPanelItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel></StackPanel>
</UserControl>
Main.xaml:
<controls:LayerPanelItem>
<TextBlock>Test</TextBlock>
<TextBlock>Test</TextBlock>
</controls:LayerPanelItem>
source
share