How to create my style based on SubheaderTextBlockStyle

I am trying to create a new style based on the existing "SubheaderTextBlockStyle" style.

I did:

 <Style x:Key="HeaderTextBlockStyle" TargetType="TextBlock"  BasedOn="{StaticResource SubheaderTextBlockStyle}">

But it cannot compile, I get a message that the Style BasedOn property should be a Style object, not a ThemeResourceExtension object.

How to get around this problem?

+4
source share
1 answer

SubheaderTextBlockStyle is the WP8.1 runtime.

This works for me using the WP8.1 RT template. Where do you define yours <Style>?

<Page.Resources>
    <Style x:Key="HeaderTextBlockStyle" TargetType="TextBlock" BasedOn="{StaticResource SubheaderTextBlockStyle}">
        <Setter Property="FontSize" Value="50"/>
    </Style>
</Page.Resources>

<Grid>
    <TextBlock Text="TEST" Style="{StaticResource HeaderTextBlockStyle}"></TextBlock>
</Grid>

enter image description here

+1
source

All Articles