TextBlock.Text Property

Definition

Gets or sets the text contents of a TextBlock.

C#
public string Text { get; set; }
XAML
<TextBlock Text="string"/>
- or -
<TextBlock>string</TextBlock>

Property Value

String

A string that specifies the text contents of this TextBlock. The default is an empty string.

Remarks

This property is not nullable. However, if you set this property to null (TextBlock1.Text = null;) no exception is thrown. Instead, it is automatically set to an empty string ("").

Applies to

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