Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 2.16 KB

File metadata and controls

69 lines (43 loc) · 2.16 KB
-api-id -api-type
T:Windows.UI.Xaml.Documents.Run
winrt class

Windows.UI.Xaml.Documents.Run

-description

Represents a discrete section of formatted or unformatted text.

-xaml-syntax

<Run .../>
-or-
<Run ...>text</Run>

-remarks

A Run represents a discrete section of formatted or unformatted text and can be used in a TextBlock or RichTextBlock. You can place multiple Run elements inside of a Span.

When you use a TextBlock, set the TextBlock.Text property directly for best performance. You typically use the Run element only when you want to format a discrete section of text within the TextBlock.

For more examples, see

-examples

Each example shown here renders the same result. However, setting the Text property directly on the TextBlock has the best performance.

<!-- Set the TextBlock.Text property directy for best performance. -->
<TextBlock Text="This is some text."/>

<TextBlock><Run>This is some text.</Run></TextBlock>

<TextBlock><Run Text="This is some text."></Run></TextBlock>
// Set the TextBlock.Text property directy for best performance.
TextBlock textblock = new TextBlock();
textblock.Text = "This is some text.";

TextBlock textblock = new TextBlock();
Run run = new Run();
run.Text = "This is some text.";
textblock.Inlines.Add(run);

-see-also

Inline, TextBlock, RichTextBlock