Documents Namespace
Namespace Avalonia.Controls.Documents
Types
- Block - Abstract base class for block-level content elements in a FlowDocument.
- BlockCollection - The blocks of a document, section, cell or list item. A document's collection is its body; the notes live in Avalonia.Controls.Documents.FlowDocument.Footnotes and the bands in Avalonia.Controls.Documents.FlowDocument.PageBands, nested documents of their own.
- BlockUIContainer - A block element that embeds an Avalonia Avalonia.Controls.Control in the document flow.
- Bold - Bold element - markup helper for indicating bolded content. Equivalent to a Span with FontWeight property set to FontWeights.Bold. Can contain other inline elements.
- DeferredImageSource - A Avalonia.Controls.Documents.RichImageSource backed by an asynchronous resolver — typically a URL fetched by a loader. The image is produced only when presented and off the UI thread; the document carries a Avalonia.Controls.Documents.DeferredImageSource.SourceUri reference rather than embedded bytes.
- EmbeddedImageSource - A Avalonia.Controls.Documents.RichImageSource whose encoded pixel bytes are embedded in the document. Decodes once from the retained bytes, caches and owns the decoded bitmap, and reports the intrinsic size from the image header without a full decode. Dispose to release the cached bitmap.
- FlowDocument - Represents a flow document that contains rich text content organized into blocks.
- FlowDocumentBuilder - Builder for creating FlowDocuments. Provides a fluent API for constructing document content.
- Footnote - A footnote as an element: the facade over a Avalonia.Controls.Documents.TextModel.TextFootnote the way Avalonia.Controls.Documents.FlowDocument is the facade over a Avalonia.Controls.Documents.TextModel.TextDocument. The text model owns the note (Avalonia.Controls.Documents.TextModel.TextDocument.Footnotes); the owning document's Avalonia.Controls.Documents.FlowDocument.Footnotes materializes this element over it on demand. Like any element, a note built from markup or code stays lazy: its text document comes into being when the owner's document initializes or when the note's content is first needed, and the model note when it joins the owner; until then the owning document is its logical parent, as for a pending block. Avalonia.Controls.Documents.Footnote.NoteId pairs the note with the Avalonia.Controls.Documents.RichFootnoteReference anchor that carries the number; the rendered number is the note's position among the document's notes, never stored here. Deleting the anchor removes the note in the same undo unit; an emptied note survives until its anchor goes. It has its own buffer, selection and caret; its undo joins the owner's stack; it never hosts anchors, notes or bands of its own.
- FootnoteCollection - The footnotes a document owns, as elements, in anchor order: a view over the text document's Avalonia.Controls.Documents.TextModel.TextDocument.Footnotes, which owns the notes, materializing a Avalonia.Controls.Documents.Footnote element per note on demand. It follows the contract of the block collection: the document becomes a note's logical parent the moment it is added; while the document has no text document the note waits pending, and it joins the text document when that is initialized, before the pending blocks materialize; once the text document exists a note joins it at once. Under the anchor-owns-its-note lifecycle the notes come and go with their anchors; a note added here pairs with the anchor carrying its id, or waits for one. Ownership is exclusive, and a nested document (a page band, a note) owns no notes.
- FootnoteNumberFormat - How a document numbers its footnotes: the format of the ordinal a Avalonia.Controls.Documents.RichFootnoteReference carries as its text and the paired Avalonia.Controls.Documents.Footnote shows in its number strip. Numbering is document-wide and continuous in anchor order; a note's identity (Avalonia.Controls.Documents.Footnote.NoteId) is never displayed.
- Inline - Inline element.
- InlineCollection - A collection of Avalonia.Controls.Documents.Inlines.
- InlineFactory - Extension methods for creating RichInline elements.
- InlineUIContainer - InlineUIContainer - a wrapper for embedded UIElements in text flow content inline collections
- Italic - Italic element - markup helper for indicating italicized content. Equivalent to a Span with FontStyle property set to FontStyles.Italic. Can contain other inline elements.
- LineBreak - LineBreak element that forces a line breaking.
- List - A block element that displays a bulleted or numbered list.
- ListItem - An item within a List element.
- MarkdownAlertBlock - A Avalonia.Controls.Documents.Section that represents a GitHub-style alert block
(
> [!NOTE]). Carries the alert kind ("Note", "Warning", ...) as a typed property so it survives element realization and is authorable through the FlowDocument API; the "alertBlock" + lowercased kind CSS classes remain the styling surface. - MarkdownCodeBlock - A Avalonia.Controls.Documents.Paragraph that represents a fenced code block. Carries the language identifier so the render layer can apply syntax highlighting without extra lookups.
- MarkdownHeading - A Avalonia.Controls.Documents.Paragraph that represents a markdown heading (H1-H6). Carries the heading level as a typed property so it survives element realization and is authorable through the FlowDocument API; the "header" / "h{level}" CSS classes remain the styling surface.
- MarkdownHtmlBlock - A Avalonia.Controls.Documents.Section that represents an HTML block from a markdown document. Its children are the rich elements the HTML converter produced; Avalonia.Controls.Documents.MarkdownHtmlBlock.RawHtml keeps the original source so an unedited block can be written back verbatim.
- MarkdownHtmlInline - A Avalonia.Controls.Documents.RichSpan that preserves an unrecognized inline HTML tag from a markdown document. Zero-length and invisible in the viewer; the markdown writer emits Avalonia.Controls.Documents.MarkdownHtmlInline.RawHtml verbatim.
- MarkdownImage - A Avalonia.Controls.Documents.RichImage that resolves its pixels from a URL through a Avalonia.Controls.MarkdownImageLoader. Carries the image URL and title; the image is loaded asynchronously when presented.
- MarkdownTaskListItem - A Avalonia.Controls.Documents.ListItem that represents a task list item (checkbox). Carries the checked state so the render layer can draw a checkbox instead of a bullet marker.
- PageBand - A page header or footer as an element: the facade over a Avalonia.Controls.Documents.TextModel.TextPageBand the way Avalonia.Controls.Documents.FlowDocument is the facade over a Avalonia.Controls.Documents.TextModel.TextDocument. The text model owns the band (Avalonia.Controls.Documents.TextModel.TextDocument.PageBands); the owning document's Avalonia.Controls.Documents.FlowDocument.PageBands materializes this element over it on demand. Like any element, a band built from markup or code stays lazy: its text document comes into being when the owner's document initializes or when the band's content is first needed, and the model band when it joins the owner; until then the owning document is its logical parent, as for a pending block. Avalonia.Controls.Documents.PageBand.Role and Avalonia.Controls.Documents.PageBand.Rule place the band by rule; a section's Avalonia.Controls.Documents.Section.Header, Avalonia.Controls.Documents.Section.Footer, Avalonia.Controls.Documents.Section.FirstPageHeader or Avalonia.Controls.Documents.Section.FirstPageFooter places it explicitly, whatever its rule, so one band can serve any number of sections. It has its own buffer, selection and caret; its undo joins the owner's stack; it never hosts footnotes or bands of its own.
- PageBandCollection - The page bands a document owns, as elements: a view over the text document's Avalonia.Controls.Documents.TextModel.TextDocument.PageBands, which owns the bands, materializing a Avalonia.Controls.Documents.PageBand element per band on demand. It follows the contract of the block collection: the document becomes a band's logical parent the moment it is added; while the document has no text document the band waits pending, and it joins the text document when that is initialized, before the pending blocks materialize; once the text document exists a band joins it at once. Removing a band releases owner, logical parent and undo and clears every section reference to it. Ownership is exclusive: a band owned by another document is refused until it is removed there. The first band with a given role and rule is the one the rule places.
- PageBandPolicy - The shared rule for which band a page shows, applied by the paged view over the text model and mirrored by the PDF export over snapshots. Explicit first, then rules, then the running band: a section's first-page reference on the section's first page; else the document's Avalonia.Controls.Documents.PageBandRule.FirstPage band on page one, else its Avalonia.Controls.Documents.PageBandRule.EvenPage band on even pages; else the section's running reference, else the document's Avalonia.Controls.Documents.PageBandRule.Default band. A rule without a band for a role does not blank the page: the running band applies. What resolves to nothing shows nothing.
- PageBandRole - The kind of page band: a header at the top of the page or a footer at the bottom.
- PageBandRule - Which pages a band claims by itself. A band with Avalonia.Controls.Documents.PageBandRule.None shows only where a section references it; the other rules place a band from the document's bands on the pages nothing explicit claims. The first band with a given role and rule is the one the rule places.
- PageNumberFieldKind - What a Avalonia.Controls.Documents.RichPageNumberField resolves to.
- PageSizes - Well-known paper sizes and page-unit conversions, in device-independent pixels
(1/96 inch) — the unit every page property in this library speaks. Assign a named
size to Avalonia.Controls.FlowDocumentPageViewer.PageSize (or the editor's page-layout
properties), feed its components to Avalonia.Controls.Documents.FlowDocument.PageWidth and
Avalonia.Controls.Documents.FlowDocument.PageHeight, or use the conversions for margins:
PagePadding = new Thickness(PageSizes.Inches(0.75)). - Paragraph - A block-level element that contains inline content.
- PixelImageSource - A Avalonia.Controls.Documents.RichImageSource backed only by decoded pixels (a
Avalonia.Controls.Documents.Imaging.PixelHolder), with no encoded payload — for images created from raw
pixels in code (e.g. a
WriteableBitmap). Capture carries the pixel buffer into the snapshot, and serializers re-encode it to a supported format. Renders by building a bitmap from the pixels, which this source owns and disposes. - RequestNavigateEventArgs - Provides data for the Avalonia.Controls.Documents.RichHyperlink.RequestNavigateEvent.
- RichBold - RichBold element - markup helper for indicating bolded content. Equivalent to a RichSpan with FontWeight property set to FontWeight.RichBold. This is the TextDocument-backed equivalent of Avalonia.Controls.Documents.RichBold.
- RichFootnoteCitation - A further citation of a footnote whose anchor is elsewhere: the same note referenced a second time, or referenced from inside another note. It shows the same number its Avalonia.Controls.Documents.RichFootnoteReference anchor does and stores it no more than the anchor does - the citation occupies a single object replacement character and rendering resolves the number from the position of the note with Avalonia.Controls.Documents.RichFootnoteCitation.NoteId among the owning document's notes, so adding or removing a note renumbers every citation of it without touching the text.
- RichFootnoteReference - A footnote anchor: an inline that marks where a note attaches to the text and shows the note's number. Nothing numeric is stored: the anchor occupies a single object replacement character, the convention an embedded object uses, and rendering resolves the number from the anchor's position - the 1-based index of its note among the document's Avalonia.Controls.Documents.FlowDocument.Footnotes, which the document keeps in anchor order. The anchor edits as one atomic unit. Avalonia.Controls.Documents.RichFootnoteReference.NoteId pairs the anchor with its Avalonia.Controls.Documents.Footnote body - deleting the anchor deletes the note, and moving an anchor moves its note with it, so the numbers follow every edit without touching the text.
- RichHyperlink - A hyperlink inline element that extends RichSpan for TextDocument integration. This is the TextDocument-backed equivalent of Avalonia.Controls.Documents.RichHyperlink.
- RichImage - An inline image embedded in text flow content. The image occupies a single character position (the object replacement character) and carries its content through its Avalonia.Controls.Documents.RichImage.Source, so it round-trips through snapshots, undo, and serialization.
- RichImageSource - Describes where a Avalonia.Controls.Documents.RichImage's pixels come from and how they are obtained. Embedded sources carry their encoded payload in the document and decode synchronously; deferred sources resolve asynchronously (e.g. from a URL via a loader) and only when the image is actually presented.
- RichImageSourceConverter - Converts a URI string into a Avalonia.Controls.Documents.RichImageSource so a
Avalonia.Controls.Documents.RichImage.Source can be authored directly in XAML — for example
<RichImage Source="avares://MyApp/Assets/picture.png" />, or a path relative to the current XAML file,<RichImage Source="/Assets/picture.png" />. - RichInline - Base class for inline elements in rich text content. This is the TextDocument-backed equivalent of Avalonia.Controls.Documents.RichInline.
- RichInlineCollection - A collection of child inline elements, validated against the inline schema.
- RichInlineUIContainer - RichInlineUIContainer - a wrapper for embedded UIElements in text flow content inline collections.
- RichItalic - RichItalic element - markup helper for indicating italicized content. Equivalent to a RichSpan with FontStyle property set to FontStyle.RichItalic. This is the TextDocument-backed equivalent of Avalonia.Controls.Documents.RichItalic.
- RichLineBreak - RichLineBreak element that forces a line breaking.
- RichPageNumberField - A page-number field: an inline that stands for the current page number or the total page count, primarily inside a Avalonia.Controls.Documents.PageBand. The number depends on pagination - the same band renders on every page with a different one - so nothing numeric is stored: the field occupies a single object replacement character and rendering resolves it against the page it lands on. Layout with no pages at all reads as a single page. The field edits as one atomic unit.
- RichRun - A terminal element in text flow hierarchy - contains a uniformatted run of unicode characters.
- RichSpan - RichSpan element used for grouping other inline elements.
- RichSubscript - RichSubscript element - markup helper for indicating subscript content. Sets BaselineAlignment to RichSubscript; font size scaling is applied at render time.
- RichSuperscript - RichSuperscript element - markup helper for indicating superscript content. Sets BaselineAlignment to RichSuperscript; font size scaling is applied at render time.
- RichTextElement - Base class for rich text elements that participate in a TextDocument.
- RichTextElementCollection<T> - A collection of child TextElements. Works both before and after document attachment.
- RichUnderline - RichUnderline element - markup helper for indicating underlined content. Equivalent to a RichSpan with TextDecorations property set to TextDecorations.RichUnderline. This is the TextDocument-backed equivalent of Avalonia.Controls.Documents.RichUnderline.
- Run - A terminal element in text flow hierarchy - contains a uniformatted run of unicode characters
- Section - A block element that groups other block elements.
- SectionBuilder - Builder for Section content.
- Span - Span element used for grouping other Inline elements.
- Table - A block element that displays content arranged in rows and columns.
- TableCell - A cell element within a Avalonia.Controls.Documents.TableRow.
- TableColumn - Defines a column in a Avalonia.Controls.Documents.Table.
- TableColumnCollection - A collection of Avalonia.Controls.Documents.TableColumn definitions for a Avalonia.Controls.Documents.TableColumnCollection.Table.
- TableRow - A row element within a Avalonia.Controls.Documents.TableRowGroup.
- TableRowGroup - Groups rows within a Avalonia.Controls.Documents.TableRowGroup.Table.
- TextElement - TextElement is an base class for content in text based controls. TextElements span other content, applying property values or providing structural information.
- Underline - Underline element - markup helper for indicating superscript content. Equivalent to a Span with TextDecorations property set to TextDecorations.Underlined. Can contain other inline elements.