FlowDocument class¶
Defined in
Namespace: CrissCross.Avalonia.UI.Controls
Assembly: CrissCross.Avalonia.UI.dll
Full name: CrissCross.Avalonia.UI.Controls.FlowDocument
Modifiers: public sealed
Summary¶
Lightweight representation of a flow document that mirrors the segments produced by RichTextDocument.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net471
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [FlowDocument](# class with a fresh [RichTextDocument](# |
Properties¶
| Name | Summary |
|---|---|
| Blocks | Gets the block collection that represents the current layout. |
| Segments | Gets the parsed segments for the current document. |
| Length | Gets the number of characters in the rendered document text. |
| ContentStart | Gets a pointer to the start of the document. |
| ContentEnd | Gets a pointer to the end of the document. |
Methods¶
| Name | Summary |
|---|---|
| SetText | Replaces the document content. |
| AppendText | Appends text to the end of the document. |
| Insert | Inserts text at the specified offset. |
| Delete | Deletes a text range. |
| Replace | Replaces a text range with new text. |
| ToggleFormatting | Toggles formatting for a specific range. |
| ClearFormatting | Removes all formatting, keeping only the textual content. |
| GetText | Gets the underlying markup/plain text. |
| GetPlainText | Gets the rendered plain text for the document. |
| GetHtmlRange | Gets the source HTML fragment for a rendered document range. |
| GetTextPointer | Creates a pointer at the specified offset. |
| GetTextRange | Gets the text within a pointer range. |
| GetRange | Gets numeric range information represented by two pointers. |
| Refresh | Rebuilds the block representation from the underlying document. |
Events¶
| Name | Summary |
|---|---|
| TextChanged | Raised whenever the underlying content changes. |