Skip to end of metadata
Go to start of metadata

Remarks

Run is used to contain unformatted text. You might expect Run objects to be used extensively in flow content. However, in markup, Run elements are not required to be used explicitly. For example, in the markup below, the first Paragraph specifies the Run element explicitly while the second does not. Both paragraphs generate identical output.

XAML

Despite the flexibility on whether or not to use Run element, you cannot combine implicit and explicit markup in a single Block element. Implicit markup is recommended if you only use text content in a Block element. Explicit markup is recommended if you need to use multiple Inline elements in a Block element.

By default, Silverlight will trim the space in front and end of the inline content. If you have multiple Inline elements and specify the content as inline content, the space at the beginning and ending of the content will be removed. This could cause the sentences to be combined without space. In this case, it is recommended that you use Text property to specify the content. If there are long words that does not fit in the available space, the word will be splitted and continued to the next line.

XAML
Note that when FlowDocument is in page mode and the textual content is rendered in the page intersection, the whole line will be shifted to the next page.

Definition

public class Run : Inline

Summary

The following table summarizes the members exposed in this class.

Public Constructors

Run Constructor()Initializes a new instance of the Run class.
Run Constructor(string)Initializes a new instance of the Run class.

Public Properties

TextGets or sets the textual content of the element.

Fields

TextPropertyIdentifies the Text dependency property.

Public Constructors

public Run()

Initializes a new instance of the Run class.

public Run(string text)

Initializes a new instance of the Run class.

Parameters

text 

 

Public Properties

public string Text { get; set; }

Gets or sets the textual content of the element.

Fields

public static readonly DependencyProperty TextProperty

Identifies the Text dependency property.

  • No labels