TextElement.Foreground Property

Definition

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

C#
public Brush Foreground { get; set; }
XAML
<textElementForeground="{StaticResource resourceName}"/>
- or -
<textElementForeground="colorString"/>
- or -
<textElement>
  <textElement.Foreground>singleBrush</textElement.Foreground>
</textElement>

Property Value

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

Remarks

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

Applies to

Product Versions
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6

See also