Section Class
Definition
A block element that groups other block elements.
public class Section
Constructors
| Name | Description |
|---|---|
| Section | No summary available. |
Section Constructor
public Section()
Methods
| Name | Description |
|---|---|
| ApplyStyling | Applies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement. |
| 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. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| EndInit | Inherited from StyledElement. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetChildIndex | Gets the zero-based index of the specified logical child within this section. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| 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. |
| 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. |
| TryGetTotalCount | No summary available. |
| VerifyAccess | Checks 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
| 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 brush used to fill the background of the control. Inherited from RichTextElement. |
| Blocks | Gets the blocks contained in this section. |
| BorderBrush | Gets or sets the brush used to paint the block border. Inherited from Block. |
| BorderThickness | Gets or sets the thickness of the block border. Inherited from Block. |
| BreakPageBefore | Gets 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. |
| Classes | Gets or sets the styled element's classes. Inherited from StyledElement. |
| ContentEnd | Gets a text pointer to the end of the content in the document. Inherited from RichTextElement. |
| ContentLength | Gets the length, in characters, that is covered by this element. Inherited from RichTextElement. |
| ContentRange | Gets the range of text that represents the entire content, or null if the content is empty or unavailable. Inherited from RichTextElement. |
| ContentStart | Gets a text pointer to the start of the content in the document. Inherited from RichTextElement. |
| CornerRadius | Gets or sets the corner radius of the block border. Inherited from Block. |
| 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. |
| FirstChildElement | Gets the first direct child element in the document tree, or if none exists. Inherited from RichTextElement. |
| FirstPageFooter | Gets or sets the footer counterpart of Avalonia.Controls.Documents.Section.FirstPageHeader. |
| FirstPageHeader | 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. |
| FlowDirection | Gets or sets the flow direction for text within the block. Inherited from Block. |
| FontFamily | Gets or sets the font family used to display text. Inherited from RichTextElement. |
| FontFeatures | Gets or sets the collection of font features to apply to the text. Inherited from RichTextElement. |
| FontSize | Gets or sets the size of the font used to display text. Inherited from RichTextElement. |
| FontStretch | Gets or sets the degree to which the font is stretched horizontally. Inherited from RichTextElement. |
| FontStyle | Gets or sets the font style used to display the text. Inherited from RichTextElement. |
| FontWeight | Gets or sets the weight or thickness of the font used to display text. Inherited from RichTextElement. |
| Footer | Gets or sets the footer counterpart of Avalonia.Controls.Documents.Section.Header. |
| Foreground | Gets or sets the brush used to paint the foreground of the control. Inherited from RichTextElement. |
| Header | 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. |
| IsAttachedToDocument | Gets a value indicating whether this element is currently attached to a Avalonia.Controls.Documents.TextModel.TextDocument. Inherited from RichTextElement. |
| IsInitialized | Gets a value that indicates whether the element has finished initialization. Inherited from StyledElement. |
| Item | Inherited from AvaloniaObject. |
| KeepTogether | Gets 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. |
| KeepWithNext | Gets 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. |
| LastChildElement | Gets the last direct child element in the document tree, or if none exists. Inherited from RichTextElement. |
| LetterSpacing | Gets or sets the letter spacing. Inherited from RichTextElement. |
| LineHeight | Gets or sets the minimum line height for text lines in the block. Inherited from Block. |
| Margin | Gets or sets the margin applied outside the block. Inherited from Block. |
| Name | Gets or sets the name of the styled element. Inherited from StyledElement. |
| NextElement | Gets the next sibling element in the document tree, or if none exists. Inherited from RichTextElement. |
| Padding | Gets or sets the padding applied inside the block border. Inherited from Block. |
| PageHeight | Gets or sets the page height for pages this section spans in paginated output. Same semantics as Avalonia.Controls.Documents.Section.PageWidth. |
| PagePadding | 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. |
| PageWidth | 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. |
| Parent | Gets the styled element's logical parent. Inherited from StyledElement. |
| PreviousElement | Gets the previous sibling element in the document tree, or if none exists. Inherited from RichTextElement. |
| Resources | Gets or sets the styled element's resource dictionary. Inherited from StyledElement. |
| StyleKey | Gets the type by which the element is styled. Inherited from StyledElement. |
| Styles | Gets the styles for the styled element. Inherited from StyledElement. |
| TabStopPositions | Gets 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. |
| TemplatedParent | Gets the styled element whose lookless template this styled element is part of. Inherited from StyledElement. |
| TextAlignment | Gets or sets the horizontal alignment of text within the block. Inherited from Block. |
| TextDocument | Gets the Avalonia.Controls.Documents.TextModel.TextDocument this element is attached to, or if not attached. Inherited from RichTextElement. |
| TextIndent | Gets 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. |
| 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. |
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; }
Footer Property
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
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
| 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. |
| 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. |
| Initialized | Occurs when the styled element has finished initialization. Inherited from StyledElement. |
| 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. |
ChildIndexChanged Event
Occurs when the child index of a logical child changes.
public event EventHandler<Avalonia.LogicalTree.ChildIndexChangedEventArgs> ChildIndexChanged