There's no ContentPresenter anymore?

That's work in september:

<Style x:Key="xy" TargetType="{x:Type TreeViewItem}">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="{x:Type TreeViewItem}">

<ContentPresenter ContentSource="Header"/>

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

but in november ctp I've got exception:

A style intended for type 'ContentControl' cannot be applied to type 'ContentPresenter'.
What's wrong with it

Thanks.



Answer this question

There's no ContentPresenter anymore?

  • Andreas P

    Based on the error message I would expect one of the following is happening:

    1) The style "xy" is being applied to an item that descends from ContentPresenter when it was designed for something that descends from ContentControl, and the error is not showing the true final classes, but ones they explicitly test for.

    2) You have a HeaderTemplate set which is defined as being a template for ContentControl and is being applied to a ContentPresenter.


  • There's no ContentPresenter anymore?