语言

Floater 构造函数

定义

初始化 Floater 类的新实例。

重载

名称 说明
Floater()

初始化 Floater 类的新实例。

Floater(Block)

使用指定的 Floater 对象作为其初始内容初始化 Block 类的新实例。

Floater(Block, TextPointer)

使用指定的 Floater 对象作为初始内容初始化 Block 类的新实例,并使用指定新 TextPointer插入位置的 Floater。

Floater()

初始化 Floater 类的新实例。

public:
 Floater();
public Floater();
Public Sub New ()

适用于

Floater(Block)

使用指定的 Floater 对象作为其初始内容初始化 Block 类的新实例。

public:
 Floater(System::Windows::Documents::Block ^ childBlock);
public Floater(System.Windows.Documents.Block childBlock);
new System.Windows.Documents.Floater : System.Windows.Documents.Block -> System.Windows.Documents.Floater
Public Sub New (childBlock As Block)

参数

childBlock
Block

新 Floater内容的初始内容。

示例

以下示例演示如何使用此构造函数。

Paragraph parx = new Paragraph(new Run("Floater content..."));
Floater flotx = new Floater(parx);
Dim parx3 As New Paragraph(New Run("Floater content..."))
Dim flotx3 As New Floater(parx3)

适用于

Floater(Block, TextPointer)

使用指定的 Floater 对象作为初始内容初始化 Block 类的新实例,并使用指定新 TextPointer插入位置的 Floater。

public:
 Floater(System::Windows::Documents::Block ^ childBlock, System::Windows::Documents::TextPointer ^ insertionPosition);
public Floater(System.Windows.Documents.Block childBlock, System.Windows.Documents.TextPointer insertionPosition);
new System.Windows.Documents.Floater : System.Windows.Documents.Block * System.Windows.Documents.TextPointer -> System.Windows.Documents.Floater
Public Sub New (childBlock As Block, insertionPosition As TextPointer)

参数

childBlock
Block

新 Floater内容的初始内容。 此参数可以是 null,在这种情况下,不会 Block 插入任何参数。

insertionPosition
TextPointer

在其创建后插入 Floater 元素的位置。

示例

以下示例演示如何使用此构造函数。

Span spanx = new Span();
Paragraph parx = new Paragraph(new Run("Floater content..."));

// This will populate the Floater with the Paragraph parx, and insert
// the Floater at the beginning of the Span spanx.
Floater flotx = new Floater(parx, spanx.ContentStart);
Dim spanx4 As New Span()
Dim parx4 As New Paragraph(New Run("Floater content..."))

    ' This will populate the Floater with the Paragraph parx, and insert
    ' the Floater at the beginning of the Span spanx.
Dim flotx4 As New Floater(parx4, spanx4.ContentStart)

适用于