Skip to main content

SelectionHighlightLayer Class

Definition​

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

Highlight layer for text selection.

public class SelectionHighlightLayer

Inheritance: object -> HighlightLayerBase -> SelectionHighlightLayer

Constructors​

SelectionHighlightLayer Constructor​

Initializes a new instance of the Avalonia.Controls.Documents.Primitives.Highlighting.SelectionHighlightLayer class.

public SelectionHighlightLayer()

Methods​

NameDescription
GetRegionsGets all highlight regions in this layer. Inherited from HighlightLayerBase.
GetRegionsInRangeGets highlight regions that intersect with the specified range. Inherited from HighlightLayerBase.
RenderRenders this layer. Inherited from HighlightLayerBase.
UpdateSelectionUpdates the selection highlight.

UpdateSelection Method​

Updates the selection highlight.

public void UpdateSelection(Avalonia.Controls.Documents.TextModel.TextPointer start, Avalonia.Controls.Documents.TextModel.TextPointer end)

Parameters​

start Avalonia.Controls.Documents.TextModel.TextPointer

The start position of the selection, or null to clear.

end Avalonia.Controls.Documents.TextModel.TextPointer

The end position of the selection, or null to clear.

Properties​

NameDescription
IsVisibleGets or sets a value indicating whether this layer is currently visible. Inherited from HighlightLayerBase.
NameGets the name that identifies this layer within a Avalonia.Controls.Documents.Primitives.Highlighting.HighlightLayerCollection, which rejects a second layer carrying the same one and looks layers up by it. Inherited from HighlightLayerBase.
SelectionBrushGets or sets the brush used for selection highlighting.
ZIndexGets the Z-index for rendering order (higher = on top). Inherited from HighlightLayerBase.

SelectionBrush Property​

Gets or sets the brush used for selection highlighting.

public Avalonia.Media.IBrush SelectionBrush { get; set; }

Events​

NameDescription
RegionsChangedEvent raised when regions change. Inherited from HighlightLayerBase.