0
votes

I am looking for a correct way to enable text wrapping in the header of Pivot control in my WP8 application.

Here is the code:

<phone:Pivot Title="MY APPLICATION">
    <phone:Pivot.HeaderTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding}" TextWrapping="Wrap"/>
        </DataTemplate>
    </phone:Pivot.HeaderTemplate>

    <phone:PivotItem Header="very long item name">
        <Grid/>
    </phone:PivotItem>
</phone:Pivot>

As you can see the 'TextWrapping' property is explicitly set to 'Wrap', but I do not observe any wrapping whatsoever. Does anyone know the workaround?

1
The TextWrapping property appears to work for TitleTemplate, but does not work for HeaderTemplate. - Aleksei Petrenko

1 Answers

1
votes

You need to set the Width of TextBlock explicitly for TextWrapping to work.

<TextBlock Text="{Binding}" TextWrapping="Wrap" MaxWidth="400" Height="Auto"/>

Above works fine.