Skip to main content

Section Class

Definition​

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

A block element that groups other block elements.

public class Section

Inheritance: object -> AvaloniaObject -> Animatable -> StyledElement -> RichTextElement -> Block -> Section

Implements: IChildIndexProvider, IAddChild<Control>, IAddChild<Block>

Constructors​

NameDescription
SectionNo summary available.

Section Constructor​

public Section()

Methods​

NameDescription
ApplyStylingApplies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement.
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.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
EndInitInherited from StyledElement.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
GetBaseValueInherited from AvaloniaObject.
GetChildIndexGets the zero-based index of the specified logical child within this section.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
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.
TryGetTotalCountNo summary available.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

GetChildIndex Method​

Gets the zero-based index of the specified logical child within this section.

public int GetChildIndex(Avalonia.LogicalTree.ILogical child)

Parameters​

child Avalonia.LogicalTree.ILogical

Returns​

int

TryGetTotalCount Method​

public bool TryGetTotalCount(int& count)

Parameters​

count int&

Returns​

bool

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 brush used to fill the background of the control. Inherited from RichTextElement.
BlocksGets the blocks contained in this section.
BorderBrushGets or sets the brush used to paint the block border. Inherited from Block.
BorderThicknessGets or sets the thickness of the block border. Inherited from Block.
BreakPageBeforeGets or sets whether paginated output (print/PDF export) starts a new page before this block. The continuous on-screen flow ignores it. Inherited from Block.
ClassesGets or sets the styled element's classes. Inherited from StyledElement.
ContentEndGets a text pointer to the end of the content in the document. Inherited from RichTextElement.
ContentLengthGets the length, in characters, that is covered by this element. Inherited from RichTextElement.
ContentRangeGets the range of text that represents the entire content, or null if the content is empty or unavailable. Inherited from RichTextElement.
ContentStartGets a text pointer to the start of the content in the document. Inherited from RichTextElement.
CornerRadiusGets or sets the corner radius of the block border. Inherited from Block.
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.
FirstChildElementGets the first direct child element in the document tree, or if none exists. Inherited from RichTextElement.
FirstPageFooterGets or sets the footer counterpart of Avalonia.Controls.Documents.Section.FirstPageHeader.
FirstPageHeaderGets or sets the header of the section's first page. Setting it is what makes the section's first page special; null starts the section like any page.
FlowDirectionGets or sets the flow direction for text within the block. Inherited from Block.
FontFamilyGets or sets the font family used to display text. Inherited from RichTextElement.
FontFeaturesGets or sets the collection of font features to apply to the text. Inherited from RichTextElement.
FontSizeGets or sets the size of the font used to display text. Inherited from RichTextElement.
FontStretchGets or sets the degree to which the font is stretched horizontally. Inherited from RichTextElement.
FontStyleGets or sets the font style used to display the text. Inherited from RichTextElement.
FontWeightGets or sets the weight or thickness of the font used to display text. Inherited from RichTextElement.
FooterGets or sets the footer counterpart of Avalonia.Controls.Documents.Section.Header.
ForegroundGets or sets the brush used to paint the foreground of the control. Inherited from RichTextElement.
HeaderGets or sets the section's header for every page the other selectors do not claim. A reference to a Avalonia.Controls.Documents.PageBand the owning document holds in Avalonia.Controls.Documents.FlowDocument.PageBands: one band can serve any number of sections. A section without a reference falls back to the document root's for the same selector. Setting an unowned band adopts it into the owning document (when the section attaches, if it is detached now); a band owned by another document is refused. Null clears the reference. Layout consults top-level sections only.
IsAttachedToDocumentGets a value indicating whether this element is currently attached to a Avalonia.Controls.Documents.TextModel.TextDocument. Inherited from RichTextElement.
IsInitializedGets a value that indicates whether the element has finished initialization. Inherited from StyledElement.
ItemInherited from AvaloniaObject.
KeepTogetherGets or sets whether paginated output (print/PDF export) avoids splitting this block across pages. Best effort: a block taller than one page still splits. The continuous on-screen flow ignores it. Inherited from Block.
KeepWithNextGets or sets whether paginated output keeps this block's end on the same page as the start of the following block. Consecutive flagged blocks move as one chain, giving up when the chain exceeds a page. The continuous on-screen flow ignores it. Inherited from Block.
LastChildElementGets the last direct child element in the document tree, or if none exists. Inherited from RichTextElement.
LetterSpacingGets or sets the letter spacing. Inherited from RichTextElement.
LineHeightGets or sets the minimum line height for text lines in the block. Inherited from Block.
MarginGets or sets the margin applied outside the block. Inherited from Block.
NameGets or sets the name of the styled element. Inherited from StyledElement.
NextElementGets the next sibling element in the document tree, or if none exists. Inherited from RichTextElement.
PaddingGets or sets the padding applied inside the block border. Inherited from Block.
PageHeightGets or sets the page height for pages this section spans in paginated output. Same semantics as Avalonia.Controls.Documents.Section.PageWidth.
PagePaddingGets or sets the page margins (paper edge to content area) for pages this section spans in paginated output. Null (the default) inherits the document's Avalonia.Controls.Documents.FlowDocument.PagePadding. Same scope rules as Avalonia.Controls.Documents.Section.PageWidth.
PageWidthGets or sets the page width, in device-independent pixels, for pages this section spans in paginated output. A section that declares any page geometry starts on a new page. NaN (the default) inherits the document's Avalonia.Controls.Documents.FlowDocument.PageWidth. The continuous flow and page bands (Avalonia.Controls.Documents.PageBandRole.Header/Avalonia.Controls.Documents.PageBandRole.Footer) ignore it.
ParentGets the styled element's logical parent. Inherited from StyledElement.
PreviousElementGets the previous sibling element in the document tree, or if none exists. Inherited from RichTextElement.
ResourcesGets or sets the styled element's resource dictionary. Inherited from StyledElement.
StyleKeyGets the type by which the element is styled. Inherited from StyledElement.
StylesGets the styles for the styled element. Inherited from StyledElement.
TabStopPositionsGets or sets the block's custom tab stop positions in device-independent pixels, measured from the content edge. Null (the default) means the block uses the default tab interval. Maps to Word's w:tabs and RTF \tx. Inherited from Block.
TemplatedParentGets the styled element whose lookless template this styled element is part of. Inherited from StyledElement.
TextAlignmentGets or sets the horizontal alignment of text within the block. Inherited from Block.
TextDocumentGets the Avalonia.Controls.Documents.TextModel.TextDocument this element is attached to, or if not attached. Inherited from RichTextElement.
TextIndentGets or sets the first-line indent in device-independent pixels; a negative value is a hanging indent. double.NaN (the default) means not set. Maps to Word's w:ind w:firstLine/w:hanging and RTF \fi. Inherited from Block.
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.

Blocks Property​

Gets the blocks contained in this section.

public Avalonia.Controls.Documents.BlockCollection Blocks { get; set; }

FirstPageFooter Property​

Gets or sets the footer counterpart of Avalonia.Controls.Documents.Section.FirstPageHeader.

public Avalonia.Controls.Documents.PageBand FirstPageFooter { get; set; }

FirstPageHeader Property​

Gets or sets the header of the section's first page. Setting it is what makes the section's first page special; null starts the section like any page.

public Avalonia.Controls.Documents.PageBand FirstPageHeader { get; set; }

Gets or sets the footer counterpart of Avalonia.Controls.Documents.Section.Header.

public Avalonia.Controls.Documents.PageBand Footer { get; set; }

Header Property​

Gets or sets the section's header for every page the other selectors do not claim. A reference to a Avalonia.Controls.Documents.PageBand the owning document holds in Avalonia.Controls.Documents.FlowDocument.PageBands: one band can serve any number of sections. A section without a reference falls back to the document root's for the same selector. Setting an unowned band adopts it into the owning document (when the section attaches, if it is detached now); a band owned by another document is refused. Null clears the reference. Layout consults top-level sections only.

public Avalonia.Controls.Documents.PageBand Header { get; set; }

PageHeight Property​

Gets or sets the page height for pages this section spans in paginated output. Same semantics as Avalonia.Controls.Documents.Section.PageWidth.

public double PageHeight { get; set; }

PagePadding Property​

Gets or sets the page margins (paper edge to content area) for pages this section spans in paginated output. Null (the default) inherits the document's Avalonia.Controls.Documents.FlowDocument.PagePadding. Same scope rules as Avalonia.Controls.Documents.Section.PageWidth.

public Avalonia.Thickness PagePadding { get; set; }

PageWidth Property​

Gets or sets the page width, in device-independent pixels, for pages this section spans in paginated output. A section that declares any page geometry starts on a new page. NaN (the default) inherits the document's Avalonia.Controls.Documents.FlowDocument.PageWidth. The continuous flow and page bands (Avalonia.Controls.Documents.PageBandRole.Header/Avalonia.Controls.Documents.PageBandRole.Footer) ignore it.

public double PageWidth { get; set; }

Fields​

NameDescription
BackgroundPropertyDefines the Avalonia.Controls.Documents.RichTextElement.Background property. Inherited from RichTextElement.
BorderBrushPropertyDefines the Avalonia.Controls.Documents.Block.BorderBrush property. Inherited from Block.
BorderThicknessPropertyDefines the Avalonia.Controls.Documents.Block.BorderThickness property. Inherited from Block.
BreakPageBeforePropertyDefines the Avalonia.Controls.Documents.Block.BreakPageBefore property. Inherited from Block.
CornerRadiusPropertyDefines the Avalonia.Controls.Documents.Block.CornerRadius property. Inherited from Block.
DataContextPropertyDefines the Avalonia.StyledElement.DataContext property. Inherited from StyledElement.
FirstPageFooterPropertyDefines the Avalonia.Controls.Documents.Section.FirstPageFooter property.
FirstPageHeaderPropertyDefines the Avalonia.Controls.Documents.Section.FirstPageHeader property.
FlowDirectionPropertyDefines the Avalonia.Controls.Documents.Block.FlowDirection property. Inherited from Block.
FontFamilyPropertyDefines the Avalonia.Controls.Documents.RichTextElement.FontFamily property. Inherited from RichTextElement.
FontFeaturesPropertyDefines the Avalonia.Controls.Documents.RichTextElement.FontFeatures property. Inherited from RichTextElement.
FontSizePropertyDefines the Avalonia.Controls.Documents.RichTextElement.FontSize property. Inherited from RichTextElement.
FontStretchPropertyDefines the Avalonia.Controls.Documents.RichTextElement.FontStretch property. Inherited from RichTextElement.
FontStylePropertyDefines the Avalonia.Controls.Documents.RichTextElement.FontStyle property. Inherited from RichTextElement.
FontWeightPropertyDefines the Avalonia.Controls.Documents.RichTextElement.FontWeight property. Inherited from RichTextElement.
FooterPropertyDefines the Avalonia.Controls.Documents.Section.Footer property.
ForegroundPropertyDefines the Avalonia.Controls.Documents.RichTextElement.Foreground property. Inherited from RichTextElement.
HeaderPropertyDefines the Avalonia.Controls.Documents.Section.Header property.
KeepTogetherPropertyDefines the Avalonia.Controls.Documents.Block.KeepTogether property. Inherited from Block.
KeepWithNextPropertyDefines the Avalonia.Controls.Documents.Block.KeepWithNext property. Inherited from Block.
LetterSpacingPropertyDefines the Avalonia.Controls.Documents.RichTextElement.LetterSpacing property. Inherited from RichTextElement.
LineHeightPropertyDefines the Avalonia.Controls.Documents.Block.LineHeight property. Inherited from Block.
MarginPropertyDefines the Avalonia.Controls.Documents.Block.Margin property. Inherited from Block.
NamePropertyDefines the Avalonia.StyledElement.Name property. Inherited from StyledElement.
PaddingPropertyDefines the Avalonia.Controls.Documents.Block.Padding property. Inherited from Block.
PageHeightPropertyDefines the Avalonia.Controls.Documents.Section.PageHeight property; see Avalonia.Controls.Documents.Section.PageWidthProperty.
PagePaddingPropertyDefines the Avalonia.Controls.Documents.Section.PagePadding property; see Avalonia.Controls.Documents.Section.PageWidthProperty.
PageWidthPropertyDefines the Avalonia.Controls.Documents.Section.PageWidth property: the document's own definition, inherited through the element tree, so a section reads the document's (or an enclosing section's) value unless it declares its own.
ParentPropertyDefines the Avalonia.StyledElement.Parent property. Inherited from StyledElement.
TabStopPositionsPropertyDefines the Avalonia.Controls.Documents.Block.TabStopPositions property. Inherited from Block.
TemplatedParentPropertyDefines the Avalonia.StyledElement.TemplatedParent property. Inherited from StyledElement.
TextAlignmentPropertyDefines the Avalonia.Controls.Documents.Block.TextAlignment property. Inherited from Block.
TextIndentPropertyDefines the Avalonia.Controls.Documents.Block.TextIndent property. Inherited from Block.
ThemePropertyDefines the Avalonia.StyledElement.Theme property. Inherited from StyledElement.
TransitionsPropertyDefines the Avalonia.Animation.Animatable.Transitions property. Inherited from Animatable.

FirstPageFooterProperty Field​

Defines the Avalonia.Controls.Documents.Section.FirstPageFooter property.

public Avalonia.StyledProperty<Avalonia.Controls.Documents.PageBand> FirstPageFooterProperty

FirstPageHeaderProperty Field​

Defines the Avalonia.Controls.Documents.Section.FirstPageHeader property.

public Avalonia.StyledProperty<Avalonia.Controls.Documents.PageBand> FirstPageHeaderProperty

FooterProperty Field​

Defines the Avalonia.Controls.Documents.Section.Footer property.

public Avalonia.StyledProperty<Avalonia.Controls.Documents.PageBand> FooterProperty

HeaderProperty Field​

Defines the Avalonia.Controls.Documents.Section.Header property.

public Avalonia.StyledProperty<Avalonia.Controls.Documents.PageBand> HeaderProperty

PageHeightProperty Field​

Defines the Avalonia.Controls.Documents.Section.PageHeight property; see Avalonia.Controls.Documents.Section.PageWidthProperty.

public Avalonia.StyledProperty<double> PageHeightProperty

PagePaddingProperty Field​

Defines the Avalonia.Controls.Documents.Section.PagePadding property; see Avalonia.Controls.Documents.Section.PageWidthProperty.

public Avalonia.StyledProperty<Avalonia.Thickness> PagePaddingProperty

PageWidthProperty Field​

Defines the Avalonia.Controls.Documents.Section.PageWidth property: the document's own definition, inherited through the element tree, so a section reads the document's (or an enclosing section's) value unless it declares its own.

public Avalonia.StyledProperty<double> PageWidthProperty

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.
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.
InitializedOccurs when the styled element has finished initialization. Inherited from StyledElement.
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.

ChildIndexChanged Event​

Occurs when the child index of a logical child changes.

public event EventHandler<Avalonia.LogicalTree.ChildIndexChangedEventArgs> ChildIndexChanged