1

I have a textblock with a style xxx that sets some properties, I want to also add add inline styles without replacing the xxx. But when it doesn't let me use <TextBlock.Style> when 'style=' is already set.

            <TextBlock Style="{StaticResource xxx}">
                <TextBlock.Style>
                    <Style TargetType="TextBlock">
                        <Setter Property="Text" Value="zzz"/>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
RollRoll
  • 8,133
  • 20
  • 76
  • 135

1 Answers1

1

Do it like this:

<TextBlock>
    <TextBlock.Style>
        <Style TargetType="TextBlock" BasedOn="{StaticResource xxx}">
            <Setter Property="Text" Value="zzz"/>
        </Style>
    </TextBlock.Style>
</TextBlock>
Tam Bui
  • 2,940
  • 2
  • 18
  • 27