Footnote Class
Definition
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.
public class Footnote
Constructors
| Name | Description |
|---|---|
| Footnote (2 overloads) | Initializes an empty note; its text document is created when first needed. |
Footnote overloads
Footnote Constructor
Initializes an empty note; its text document is created when first needed.
public Footnote()
Footnote Constructor
Initializes a note over an existing note-rooted text document (Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind.Footnote).
public Footnote(Avalonia.Controls.Documents.TextModel.TextDocument textDocument)
Parameters
textDocument Avalonia.Controls.Documents.TextModel.TextDocument
Methods
| Name | Description |
|---|---|
| ApplyBlockFormatting | Applies captured formatting to an element. Inherited from FlowDocument. |
| ApplyInlineFormatting | Applies captured formatting to an element. Inherited from FlowDocument. |
| ApplyListItemFormatting | Applies captured formatting to an element. Inherited from FlowDocument. |
| ApplyStyling | Applies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement. |
| ApplyTableCellFormatting | Applies captured formatting to an element. Inherited from FlowDocument. |
| ApplyTableRowFormatting | Applies captured formatting to an element. Inherited from FlowDocument. |
| ApplyTextElementFormatting | Applies captured formatting to an element. Inherited from FlowDocument. |
| BeginInit | Inherited from StyledElement. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| Clone | Creates a deep, independent copy of this document — content, block/inline structure, formatting and page settings. The source document is left untouched. This is the way to show the same content in several places at once; adding this document's blocks to another document moves them instead, because an element belongs to exactly one document at a time. Inherited from FlowDocument. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| CreateSnapshot | Creates an immutable, thread-safe snapshot of the current document state. Inherited from FlowDocument. |
| EndInit | Inherited from StyledElement. |
| EnsureTextDocument | Creates the backing store if it does not exist yet, and returns it. Inherited from FlowDocument. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| FindFootnote | The note paired with anchor, or null while the anchor has none (a dangling anchor, or one not in this document). Under the anchor-owns-its-note lifecycle a note exists for every anchor added through the element channel - this is how callers reach it. Inherited from FlowDocument. |
| FromSnapshot | Inherited from FlowDocument. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| InitializeTextDocument | Creates the backing store if it does not exist yet, and returns it. Inherited from FlowDocument. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject. |
| Load (2 overloads) | Reads a document from a stream. Inherited from FlowDocument. |
| LoadAsync | Loads a document from a stream, parsing off the calling thread. Inherited from FlowDocument. |
| Save (2 overloads) | Writes this document to a stream. Inherited from FlowDocument. |
| SaveAsync | Saves the document to a stream, writing off the calling thread. Inherited from FlowDocument. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| TryGetResource | Inherited from StyledElement. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
Properties
| Name | Description |
|---|---|
| ActualThemeVariant | Gets the UI theme that is currently used by the element, which might be different than the RequestedThemeVariantProperty. Inherited from StyledElement. |
| Background | Gets or sets the document-level background brush. Inherited from FlowDocument. |
| Blocks | Gets the top-level blocks that make up this document's content. Inherited from FlowDocument. |
| Classes | Gets or sets the styled element's classes. Inherited from StyledElement. |
| ContentEnd | Gets a pointer at the end of the document content, or null while no backing store exists. Inherited from FlowDocument. |
| ContentRange | Gets a range covering the whole document, or null while no backing store exists. Inherited from FlowDocument. |
| ContentStart | Gets a pointer at the start of the document content, or null while no backing store exists. Inherited from FlowDocument. |
| DataContext | Gets or sets the control's data context. Inherited from StyledElement. |
| Dispatcher | Returns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject. |
| FontFamily | Gets or sets the document-level font family. Inherited from FlowDocument. |
| FontSize | Gets or sets the document-level font size in device-independent pixels. Inherited from FlowDocument. |
| FontStretch | Gets or sets the document-level font stretch. Inherited from FlowDocument. |
| FontStyle | Gets or sets the document-level font style. Inherited from FlowDocument. |
| FontWeight | Gets or sets the document-level font weight. Inherited from FlowDocument. |
| FootnoteNumberFormat | Gets or sets how the document numbers its footnotes: the format of the ordinal each Avalonia.Controls.Documents.RichFootnoteReference renders and its note shows in its number strip. The text document owns the numbering (Avalonia.Controls.Documents.TextModel.TextDocument.FootnoteNumberFormat): a change is one undo unit that re-renders every anchor and note, and a value set before the text document exists applies when it is created. A nested document (a band, a note) ignores it. Inherited from FlowDocument. |
| Footnotes | Gets the footnotes this document owns, in anchor order: nested documents like Avalonia.Controls.Documents.FlowDocument.PageBands, each paired by id with the anchor in the body that carries its number. The text document owns them (Avalonia.Controls.Documents.TextModel.TextDocument.Footnotes); they resolve resources and inherited formatting through this element and record undo into the shared undo manager. Notes come and go with their anchors (Avalonia.Controls.Documents.FlowDocument.FindFootnote(Avalonia.Controls.Documents.RichFootnoteReference)); a nested document has none. Inherited from FlowDocument. |
| Foreground | Gets or sets the document-level foreground brush. Inherited from FlowDocument. |
| IsDocumentInitialized | Whether the backing store has been created. Inherited from FlowDocument. |
| IsInitialized | Gets a value that indicates whether the element has finished initialization. Inherited from StyledElement. |
| Item | Inherited from AvaloniaObject. |
| Label | Gets or sets the note's name in formats that address notes by name (markdown's [^label]). Never displayed and null for a note created in the editor; a writer that needs a name derives one from the note's position. |
| Name | Gets or sets the name of the styled element. Inherited from StyledElement. |
| Note | The text-model note this element is the facade over, null until the note joins a document or was created over an existing text document. |
| NoteId | Gets or sets the identity pairing this note with its anchor. Document-unique; assigned by the pairing (Avalonia.Controls.Documents.TextModel.TextRange.InsertFootnote(Avalonia.Controls.Documents.RichFootnoteReference)), 0 while unpaired. The displayed number is not the id: ordinals follow anchor order. |
| Owner | The document element that owns the note: its logical parent while it waits for the owner's text document, the owner's facade once the text model holds it; null while unowned or when the owner has no element facade. |
| PageBandDistance | Gets or sets the distance from the sheet edge to a page band in DIPs: the header's top sits this far below the sheet top, the footer's bottom this far above the sheet bottom. NaN (the default) leaves it to Avalonia.Controls.Documents.PageBandPolicy.DefaultDistance. Inherited from FlowDocument. |
| PageBands | Gets the page bands this document owns: the nested documents its root and top-level sections reference as headers and footers. A band added here - or adopted when an unowned band is set on a reference - belongs to this document: the text document owns it (Avalonia.Controls.Documents.TextModel.TextDocument.PageBands), it resolves resources and inherited formatting through this element and records undo into the shared undo manager. Removing a band clears every reference to it. Inherited from FlowDocument. |
| PageHeight | Gets or sets the document page height in DIPs. Set NaN for automatic height from the attached view. Inherited from FlowDocument. |
| PagePadding | Gets or sets the document-level page padding (page margins in document formats). Sections inherit it, like Avalonia.Controls.Documents.FlowDocument.PageWidth and Avalonia.Controls.Documents.FlowDocument.PageHeight, unless they declare their own. Inherited from FlowDocument. |
| PageWidth | Gets or sets the document page width in DIPs. Set NaN for automatic width from the attached view. Inherited from FlowDocument. |
| Parent | Gets the styled element's logical parent. Inherited from StyledElement. |
| Resources | Gets or sets the styled element's resource dictionary. Inherited from StyledElement. |
| RootKind | The kind of the text document's root node: what kind of document this is. Inherited from FlowDocument. |
| StyleKey | Gets the type by which the element is styled. Inherited from StyledElement. |
| Styles | Gets the styles for the styled element. Inherited from StyledElement. |
| TemplatedParent | Gets the styled element whose lookless template this styled element is part of. Inherited from StyledElement. |
| TextAlignment | Gets or sets the default text alignment for blocks in the document. Inherited from FlowDocument. |
| TextDocument | Gets the Avalonia.Controls.Documents.TextModel.TextDocument backing store, creating it on first read. Inherited from FlowDocument. |
| Theme | Gets or sets the theme to be applied to the element. Inherited from StyledElement. |
| Transitions | Gets or sets the property transitions for the control. Inherited from Animatable. |
Label Property
Gets or sets the note's name in formats that address notes by name
(markdown's [^label]). Never displayed and null for a note created in
the editor; a writer that needs a name derives one from the note's position.
public string Label { get; set; }
Note Property
The text-model note this element is the facade over, null until the note joins a document or was created over an existing text document.
public Avalonia.Controls.Documents.TextModel.TextFootnote Note { get; set; }
NoteId Property
Gets or sets the identity pairing this note with its anchor. Document-unique; assigned by the pairing (Avalonia.Controls.Documents.TextModel.TextRange.InsertFootnote(Avalonia.Controls.Documents.RichFootnoteReference)), 0 while unpaired. The displayed number is not the id: ordinals follow anchor order.
public int NoteId { get; set; }
Owner Property
The document element that owns the note: its logical parent while it waits for the owner's text document, the owner's facade once the text model holds it; null while unowned or when the owner has no element facade.
public Avalonia.Controls.Documents.FlowDocument Owner { get; set; }
Fields
LabelProperty Field
Defines the Avalonia.Controls.Documents.Footnote.Label property.
public Avalonia.StyledProperty<string> LabelProperty
NoteIdProperty Field
Defines the Avalonia.Controls.Documents.Footnote.NoteId property.
public Avalonia.StyledProperty<int> NoteIdProperty
Events
| Name | Description |
|---|---|
| ActualThemeVariantChanged | Raised when the theme variant is changed on the element or an ancestor of the element. Inherited from StyledElement. |
| AttachedToLogicalTree | Raised when the styled element is attached to a rooted logical tree. Inherited from StyledElement. |
| ChildIndexChanged | Occurs when the child index of a logical child changes. Inherited from FlowDocument. |
| DataContextChanged | Occurs when the Avalonia.StyledElement.DataContext property changes. Inherited from StyledElement. |
| DetachedFromLogicalTree | Raised when the styled element is detached from a rooted logical tree. Inherited from StyledElement. |
| FootnotesChanged | Raised when the set of notes changes, a note's id or label changes, or the numbering format changes: the notes a page shows and the numbers they show follow from these, so views re-place them. Inherited from FlowDocument. |
| Initialized | Occurs when the styled element has finished initialization. Inherited from StyledElement. |
| PageBandsChanged | Raised when the set of bands changes or a band's role or rule changes: the pages a band claims by rule follow from these, so views re-resolve their sheets. Inherited from FlowDocument. |
| PropertyChanged | Raised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject. |
| ResourcesChanged | Occurs when a resource in this styled element or a parent styled element has changed. Inherited from StyledElement. |