I need create many TextBlock with same text.
I can set multiline text in TextBlock like this:
<TextBlock>
<Run Foreground="Red">the first line</Run><LineBreak />
the second line
</TextBlock>
I want to create a style for those TextBlock, so I try this:
<Style TargetType="TextBlock" x:Key="text1">
<Setter Property="Text">
<Setter.Value>
<Run Foreground="Red">the first line</Run>
<LineBreak />
the second line
</Setter.Value>
</Setter>
</Style>
But it's not work.
I think maybe I should add something in <Setter.Value>
, I tried a few things but nothing worked, either.
Sorry for bad English and thanks for any idea.