How do I create a custom contentpane header? I naively tried:
<ContentPane ...>
<ContentPane.Header>
<TextBox .... />
</ContentPane.Header>
</ContentPane>
But it doesn't work.
It depends on what you mean by a custom header. If you want to alter the caption area itself then you would want to retemplate/style the PaneHeaderPresenter. If you just want to alter the area within the PaneHeaderPresenter that is used to display the header of the ContentPane then you can provide a custom HeaderTemplate.
Hi Andrew,
ContentPane is a HeaderedContentControl, which means I could push any control inside like this:
<Button Content="fff"/>
This construct actually constantly fails with 'already has a logical child' wpf exception while it perfectly works for HeaderedContentControl.
The same happens when I try to set TabHeader. I think you should not force using the HeaderTemplate/TabHeaderTemplate for setting this. It's rather annoying. Why should I provide a data entity + data template when I already have a (working) User Control which represents my header?
Moreover, I think such design violates the meaning of Headered Control and its Header property.
Thanks.
Thanks Andrew, can you give me an example of providing a custom HeaderTemplate? I tried something simple like:
<DataTemplate x:Key="dockHeaderTemplate">
<TextBlock FontSize="16" Foreground="Red" Text="John was here" />
</DataTemplate>
..and used it like this
.. HeaderTemplate="{StaticResource dockHeaderTemplate}"
but it had no effect