views:

6

answers:

0

I have a custom ItemsControl (WorKArea) that marks all items it has into a WorkSheet instance.

I have a style for the ItemsControl that uses a TabControl to show the content. Every sheet creates a tab. The style is:

<Style TargetType="{x:Type local:WorkArea}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type local:WorkArea}">
                <TabControl ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkArea}}, Path=Items}">
                    <TabControl.ItemContainerStyle>
                        <Style TargetType="TabItem">
                            <Setter Property="Header" Value="{Binding Title}" />
                        </Style>
                    </TabControl.ItemContainerStyle>
                </TabControl>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

So far so good. The "sheets" show up, and the title is properly bound to the Header.

How can I get the tabs showing the content now? Whatever I try, nothing shows up at all for every WorkSheet - the content is always empty. Anyone the proper code?