The Foreground property enables you to specify a Brush for the rendered text. The following XAML example shows the simplest usage for Foreground, which is to use a named color string that applies a SolidColorBrush of that color to the text. Notice that Foreground is set separately on TextBlock and on each of the Run text elements within it.
<!-- TextBlock with different brushes applied to parts of the text. -->
<TextBlock
FontFamily="Verdana"
Foreground="Navy">
Navy
<Run Text="DodgerBlue " Foreground="DodgerBlue"/>
<Run Text="LightSteelBlue " Foreground="LightSteelBlue"/>
</TextBlock>
Loading

Join the conversation! Your thoughts help the community grow.