TextElement.Foreground Property


Gets or sets the Brush to apply to the content in this element.

 property Brush ^ Foreground { Brush ^ get(); void set(Brush ^ value); };
Brush Foreground();

void Foreground(Brush value);
public Brush Foreground { get; set; }
var brush = textElement.foreground;
textElement.foreground = brush;
Public Property Foreground As Brush
<textElementForeground="{StaticResource resourceName}"/>
- or -
- or -

Property Value


The brush that is applied to the text content. The default is a SolidColorBrush with Color value Black.


Setting Foreground has no visible effect for LineBreak or InlineUIContainer objects.

Applies to

See also