Skip to main content

Footnote Class

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

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

Inheritance: object -> AvaloniaObject -> Animatable -> StyledElement -> FlowDocument -> Footnote

Constructors​

NameDescription
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​

NameDescription
ApplyBlockFormattingApplies captured formatting to an element. Inherited from FlowDocument.
ApplyInlineFormattingApplies captured formatting to an element. Inherited from FlowDocument.
ApplyListItemFormattingApplies captured formatting to an element. Inherited from FlowDocument.
ApplyStylingApplies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement.
ApplyTableCellFormattingApplies captured formatting to an element. Inherited from FlowDocument.
ApplyTableRowFormattingApplies captured formatting to an element. Inherited from FlowDocument.
ApplyTextElementFormattingApplies captured formatting to an element. Inherited from FlowDocument.
BeginInitInherited from StyledElement.
Bind (8 overloads)Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject.
CheckAccessReturns 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.
CloneCreates 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.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
CreateSnapshotCreates an immutable, thread-safe snapshot of the current document state. Inherited from FlowDocument.
EndInitInherited from StyledElement.
EnsureTextDocumentCreates the backing store if it does not exist yet, and returns it. Inherited from FlowDocument.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
FindFootnoteThe 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.
FromSnapshotInherited from FlowDocument.
GetBaseValueInherited from AvaloniaObject.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
InitializeTextDocumentCreates the backing store if it does not exist yet, and returns it. Inherited from FlowDocument.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
Load (2 overloads)Reads a document from a stream. Inherited from FlowDocument.
LoadAsyncLoads 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.
SaveAsyncSaves 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.
TryGetResourceInherited from StyledElement.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

Properties​

NameDescription
ActualThemeVariantGets the UI theme that is currently used by the element, which might be different than the RequestedThemeVariantProperty. Inherited from StyledElement.
BackgroundGets or sets the document-level background brush. Inherited from FlowDocument.
BlocksGets the top-level blocks that make up this document's content. Inherited from FlowDocument.
ClassesGets or sets the styled element's classes. Inherited from StyledElement.
ContentEndGets a pointer at the end of the document content, or null while no backing store exists. Inherited from FlowDocument.
ContentRangeGets a range covering the whole document, or null while no backing store exists. Inherited from FlowDocument.
ContentStartGets a pointer at the start of the document content, or null while no backing store exists. Inherited from FlowDocument.
DataContextGets or sets the control's data context. Inherited from StyledElement.
DispatcherReturns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject.
FontFamilyGets or sets the document-level font family. Inherited from FlowDocument.
FontSizeGets or sets the document-level font size in device-independent pixels. Inherited from FlowDocument.
FontStretchGets or sets the document-level font stretch. Inherited from FlowDocument.
FontStyleGets or sets the document-level font style. Inherited from FlowDocument.
FontWeightGets or sets the document-level font weight. Inherited from FlowDocument.
FootnoteNumberFormatGets 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.
FootnotesGets 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.
ForegroundGets or sets the document-level foreground brush. Inherited from FlowDocument.
IsDocumentInitializedWhether the backing store has been created. Inherited from FlowDocument.
IsInitializedGets a value that indicates whether the element has finished initialization. Inherited from StyledElement.
ItemInherited from AvaloniaObject.
LabelGets 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.
NameGets or sets the name of the styled element. Inherited from StyledElement.
NoteThe text-model note this element is the facade over, null until the note joins a document or was created over an existing text document.
NoteIdGets 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.
OwnerThe 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.
PageBandDistanceGets 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.
PageBandsGets 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.
PageHeightGets or sets the document page height in DIPs. Set NaN for automatic height from the attached view. Inherited from FlowDocument.
PagePaddingGets 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.
PageWidthGets or sets the document page width in DIPs. Set NaN for automatic width from the attached view. Inherited from FlowDocument.
ParentGets the styled element's logical parent. Inherited from StyledElement.
ResourcesGets or sets the styled element's resource dictionary. Inherited from StyledElement.
RootKindThe kind of the text document's root node: what kind of document this is. Inherited from FlowDocument.
StyleKeyGets the type by which the element is styled. Inherited from StyledElement.
StylesGets the styles for the styled element. Inherited from StyledElement.
TemplatedParentGets the styled element whose lookless template this styled element is part of. Inherited from StyledElement.
TextAlignmentGets or sets the default text alignment for blocks in the document. Inherited from FlowDocument.
TextDocumentGets the Avalonia.Controls.Documents.TextModel.TextDocument backing store, creating it on first read. Inherited from FlowDocument.
ThemeGets or sets the theme to be applied to the element. Inherited from StyledElement.
TransitionsGets 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​

NameDescription
BackgroundPropertyDefines the Avalonia.Controls.Documents.FlowDocument.Background property. Inherited from FlowDocument.
DataContextPropertyDefines the Avalonia.StyledElement.DataContext property. Inherited from StyledElement.
FontFamilyPropertyDefines the Avalonia.Controls.Documents.FlowDocument.FontFamily property. Inherited from FlowDocument.
FontSizePropertyDefines the Avalonia.Controls.Documents.FlowDocument.FontSize property. Inherited from FlowDocument.
FontStretchPropertyDefines the Avalonia.Controls.Documents.FlowDocument.FontStretch property. Inherited from FlowDocument.
FontStylePropertyDefines the Avalonia.Controls.Documents.FlowDocument.FontStyle property. Inherited from FlowDocument.
FontWeightPropertyDefines the Avalonia.Controls.Documents.FlowDocument.FontWeight property. Inherited from FlowDocument.
FootnoteNumberFormatPropertyDefines the Avalonia.Controls.Documents.FlowDocument.FootnoteNumberFormat property. Inherited from FlowDocument.
ForegroundPropertyDefines the Avalonia.Controls.Documents.FlowDocument.Foreground property. Inherited from FlowDocument.
LabelPropertyDefines the Avalonia.Controls.Documents.Footnote.Label property.
NamePropertyDefines the Avalonia.StyledElement.Name property. Inherited from StyledElement.
NoteIdPropertyDefines the Avalonia.Controls.Documents.Footnote.NoteId property.
PageBandDistancePropertyDefines the Avalonia.Controls.Documents.FlowDocument.PageBandDistance property. NaN means the document declares none and the default distance applies. Inherited from FlowDocument.
PageHeightPropertyDefines the Avalonia.Controls.Documents.FlowDocument.PageHeight property. NaN means automatic height from the attached view. Inherited from FlowDocument.
PagePaddingPropertyDefines the Avalonia.Controls.Documents.FlowDocument.PagePadding property. Inherited from FlowDocument.
PageWidthPropertyDefines the Avalonia.Controls.Documents.FlowDocument.PageWidth property. NaN means automatic width from the attached view. Inherited from FlowDocument.
ParentPropertyDefines the Avalonia.StyledElement.Parent property. Inherited from StyledElement.
TemplatedParentPropertyDefines the Avalonia.StyledElement.TemplatedParent property. Inherited from StyledElement.
TextAlignmentPropertyDefines the Avalonia.Controls.Documents.FlowDocument.TextAlignment property. Inherited from FlowDocument.
ThemePropertyDefines the Avalonia.StyledElement.Theme property. Inherited from StyledElement.
TransitionsPropertyDefines the Avalonia.Animation.Animatable.Transitions property. Inherited from Animatable.

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​

NameDescription
ActualThemeVariantChangedRaised when the theme variant is changed on the element or an ancestor of the element. Inherited from StyledElement.
AttachedToLogicalTreeRaised when the styled element is attached to a rooted logical tree. Inherited from StyledElement.
ChildIndexChangedOccurs when the child index of a logical child changes. Inherited from FlowDocument.
DataContextChangedOccurs when the Avalonia.StyledElement.DataContext property changes. Inherited from StyledElement.
DetachedFromLogicalTreeRaised when the styled element is detached from a rooted logical tree. Inherited from StyledElement.
FootnotesChangedRaised 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.
InitializedOccurs when the styled element has finished initialization. Inherited from StyledElement.
PageBandsChangedRaised 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.
PropertyChangedRaised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject.
ResourcesChangedOccurs when a resource in this styled element or a parent styled element has changed. Inherited from StyledElement.