Run.Text Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the text contents of the Run.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
<Run ...>text</Run>
<Run Text="text"/>
Property Value
Type: System.StringA string that specifies the text contents of the Run. The default is String.Empty.
Any leading or trailing white space is not preserved when you set the Text property in XAML or in code.
When you set text in a TextBlock or a Run, it is not necessary to explicitly specify the Text property in XAML. Instead, you can put the text directly within the element, as shown in the following example.
<TextBlock>Hello, world!</TextBlock> <TextBlock> <TextBlock.Inlines> <Run>Hello again, world!</Run> </TextBlock.Inlines> </TextBlock>
Show: