FlowDocumentBuilder Class
Definition
Builder for creating FlowDocuments. Provides a fluent API for constructing document content.
public class FlowDocumentBuilder
Methods
| Name | Description |
|---|---|
| AddBold | Adds bold text to the current paragraph. |
| AddHyperlink | Adds a hyperlink to the current paragraph. |
| AddInline | Adds an inline element to the current paragraph. |
| AddItalic | Adds italic text to the current paragraph. |
| AddListItem (2 overloads) | Adds a new empty list item to the current list. |
| AddParagraph (3 overloads) | Adds a new empty paragraph. |
| AddSection | No summary available. |
| AddTableCell | Adds a table cell with the specified text. |
| AddText | Adds text to the current paragraph. |
| AddUnderline | Adds underlined text to the current paragraph. |
| Build | Builds the document and creates its backing store, so the content the builder staged is live when the caller receives it. |
| Create | Creates a new FlowDocumentBuilder. |
| EndList | Ends the current list and restores the parent list if nested. |
| EndTable | Ends the current table. |
| EndTableCell | Ends the current table cell. |
| EndTableRow | Ends the current table row. |
| GetDocument | Gets the document without initializing its Avalonia.Controls.Documents.TextModel.TextDocument. |
| SetTableCellBackground | Sets the background color of the current table cell. |
| SetTableColumns | No summary available. |
| StartList | Starts a new list with the specified marker style. |
| StartNestedList | Starts a nested list inside the current list item. |
| StartTable | Starts a new table. |
| StartTableCell | Starts a new table cell. |
| StartTableRow | Starts a new table row. |
AddBold Method
Adds bold text to the current paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddBold(string text)
Parameters
text string
Returns
AddHyperlink Method
Adds a hyperlink to the current paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddHyperlink(string text, Uri navigateUri)
Parameters
text string
navigateUri Uri
Returns
AddInline Method
Adds an inline element to the current paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddInline(Avalonia.Controls.Documents.RichInline inline)
Parameters
inline Avalonia.Controls.Documents.RichInline
Returns
AddItalic Method
Adds italic text to the current paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddItalic(string text)
Parameters
text string
Returns
AddListItem overloads
AddListItem Method
Adds a new empty list item to the current list.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddListItem()
Returns
AddListItem Method
Adds a new list item to the current list.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddListItem(string text)
Parameters
text string
Returns
AddParagraph overloads
AddParagraph Method
Adds a new empty paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddParagraph()
Returns
AddParagraph Method
Adds a paragraph with the specified inline elements.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddParagraph(Avalonia.Controls.Documents.RichInline[] inlines)
Parameters
inlines Avalonia.Controls.Documents.RichInline[]
Returns
AddParagraph Method
Adds a new paragraph with the specified text.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddParagraph(string text)
Parameters
text string
Returns
AddSection Method
public Avalonia.Controls.Documents.FlowDocumentBuilder AddSection(Action<Avalonia.Controls.Documents.SectionBuilder> configure)
Parameters
configure Action<Avalonia.Controls.Documents.SectionBuilder>
Returns
AddTableCell Method
Adds a table cell with the specified text.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddTableCell(string text)
Parameters
text string
Returns
AddText Method
Adds text to the current paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddText(string text)
Parameters
text string
Returns
AddUnderline Method
Adds underlined text to the current paragraph.
public Avalonia.Controls.Documents.FlowDocumentBuilder AddUnderline(string text)
Parameters
text string
Returns
Build Method
Builds the document and creates its backing store, so the content the builder staged is live when the caller receives it.
public Avalonia.Controls.Documents.FlowDocument Build()
Returns
Avalonia.Controls.Documents.FlowDocument
The built document.
Create Method
Creates a new FlowDocumentBuilder.
public Avalonia.Controls.Documents.FlowDocumentBuilder Create()
Returns
EndList Method
Ends the current list and restores the parent list if nested.
public Avalonia.Controls.Documents.FlowDocumentBuilder EndList()
Returns
EndTable Method
Ends the current table.
public Avalonia.Controls.Documents.FlowDocumentBuilder EndTable()
Returns
EndTableCell Method
Ends the current table cell.
public Avalonia.Controls.Documents.FlowDocumentBuilder EndTableCell()
Returns
EndTableRow Method
Ends the current table row.
public Avalonia.Controls.Documents.FlowDocumentBuilder EndTableRow()
Returns
GetDocument Method
Gets the document without initializing its Avalonia.Controls.Documents.TextModel.TextDocument.
public Avalonia.Controls.Documents.FlowDocument GetDocument()
Returns
Avalonia.Controls.Documents.FlowDocument
The document under construction.
Remarks
Call Avalonia.Controls.Documents.FlowDocumentBuilder.Build. A document handed out here carries no text model, so reading or serializing it sees an empty document until something initializes one.
SetTableCellBackground Method
Sets the background color of the current table cell.
public Avalonia.Controls.Documents.FlowDocumentBuilder SetTableCellBackground(Avalonia.Media.Color color)
Parameters
color Avalonia.Media.Color
Returns
SetTableColumns Method
public Avalonia.Controls.Documents.FlowDocumentBuilder SetTableColumns(System.Collections.Generic.IReadOnlyList<double> widths)
Parameters
widths System.Collections.Generic.IReadOnlyList<double>
Returns
StartList Method
Starts a new list with the specified marker style.
public Avalonia.Controls.Documents.FlowDocumentBuilder StartList(Avalonia.Controls.Documents.Primitives.DocumentNodes.TextMarkerStyle markerStyle, int startIndex)
Parameters
markerStyle Avalonia.Controls.Documents.Primitives.DocumentNodes.TextMarkerStyle
startIndex int
Returns
StartNestedList Method
Starts a nested list inside the current list item.
public Avalonia.Controls.Documents.FlowDocumentBuilder StartNestedList(Avalonia.Controls.Documents.Primitives.DocumentNodes.TextMarkerStyle markerStyle, int startIndex)
Parameters
markerStyle Avalonia.Controls.Documents.Primitives.DocumentNodes.TextMarkerStyle
startIndex int
Returns
StartTable Method
Starts a new table.
public Avalonia.Controls.Documents.FlowDocumentBuilder StartTable()
Returns
StartTableCell Method
Starts a new table cell.
public Avalonia.Controls.Documents.FlowDocumentBuilder StartTableCell()
Returns
StartTableRow Method
Starts a new table row.
public Avalonia.Controls.Documents.FlowDocumentBuilder StartTableRow()