Intersoft ClientUI Documentation
Run Class
Members  See Also  Send Feedback
Intersoft.Client.Documents Namespace : Run Class






An inline-level flow content element intended to contain a run of formatted or unformatted text.

Object Model

Run Class

Syntax

Visual Basic (Declaration) 
<ContentPropertyAttribute("Text")>
Public Class Run 
   Inherits Inline
Visual Basic (Usage)Copy Code
Dim instance As Run
C# 
[ContentPropertyAttribute("Text")]
public class Run : Inline 
Delphi 
public class Run = class(Inline)
JScript 
ContentPropertyAttribute("Text")
public class Run extends Inline
Managed Extensions for C++ 
[ContentPropertyAttribute("Text")]
public __gc class Run : public Inline 
C++/CLI 
[ContentPropertyAttribute("Text")]
public ref class Run : public Inline 

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 Copy Code
<Intersoft:FlowDocument>
    <Intersoft:Paragraph>
        <Intersoft:Run>
            Paragraph that explicitly uses the Run element.
        </Intersoft:Run>
    </Intersoft:Paragraph>
    <Intersoft:Paragraph>
        This Paragraph omits the the Run element in markup. It renders the same as a Paragraph with Run used explicitly.
    </Intersoft:Paragraph>
</Intersoft:FlowDocument>

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 Copy Code
<Intersoft:FlowDocument>
    <Intersoft:Paragraph>
        <Intersoft:Run Text="Lorem ipsum dolor sit amet, "/>
        <Intersoft:Italic>
            <Intersoft:Run Text="consectetur adipisicing elit, "/>
        </Intersoft:Italic>
        <Intersoft:Run Text="sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
    </Intersoft:Paragraph>
</Intersoft:FlowDocument>

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.

Inheritance Hierarchy

System.Object
   System.Windows.DependencyObject
      Intersoft.Client.Documents.TextElement
         Intersoft.Client.Documents.Inline
            Intersoft.Client.Documents.Run

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.