How to set HubSection Header Style

windows-8.1, windows-phone-7, windows-phone-8, xaml

Solution

The property you want to change isn't `Header` but `HeaderTemplate`. Here's my working example:

<Style TargetType="HubSection">
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate>
                <TextBlock Text="{Binding}"
                           FontSize="100"
                           Foreground="Yellow"/>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

If you want to apply this style to all `Hub` controls in your app, just remove the `Key` and place it in the App.xaml file in `Resources`.

Problem

I want to change Font Family, Font Size and Foreground color for HubSection Header. Something like this: ``` <Style TargetType="HubSection" x:Key="HubSection"> <Setter Property="Header"> <Setter.Value> <Setter Property="FontSize" Value="100"></Setter> <Setter Property="Foreground" Value="Yellow"></Setter> </Setter.Value> </Setter> </Style> <HubSection Width="500" Header="Section Name" Style="{StaticResource HubSection}"> ``` How can I do it?

Original source