Skip to main content

HighlightLayerBase Class

Definition​

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

Base class for highlight layer implementations. Provides common functionality for managing and rendering highlight regions.

public class HighlightLayerBase

Inheritance: object -> HighlightLayerBase

Implements:IHighlightLayer

Methods​

NameDescription
GetRegionsGets all highlight regions in this layer.
GetRegionsInRangeGets highlight regions that intersect with the specified range.
RenderRenders this layer.

GetRegions Method​

Gets all highlight regions in this layer.

public System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Documents.Primitives.Highlighting.HighlightRegion> GetRegions()

Returns​

System.Collections.Generic.IReadOnlyList<Avalonia.Controls.Documents.Primitives.Highlighting.HighlightRegion>

A read-only list of highlight regions.

GetRegionsInRange Method​

Gets highlight regions that intersect with the specified range.

public System.Collections.Generic.IEnumerable<Avalonia.Controls.Documents.Primitives.Highlighting.HighlightRegion> GetRegionsInRange(Avalonia.Controls.Documents.TextModel.TextPointer start, Avalonia.Controls.Documents.TextModel.TextPointer end)

Parameters​

start Avalonia.Controls.Documents.TextModel.TextPointer

The start position of the range.

end Avalonia.Controls.Documents.TextModel.TextPointer

The end position of the range.

Returns​

System.Collections.Generic.IEnumerable<Avalonia.Controls.Documents.Primitives.Highlighting.HighlightRegion>

An enumerable of regions that intersect with the range.

Render Method​

Renders this layer.

public void Render(Avalonia.Media.DrawingContext context, Avalonia.Controls.Documents.Primitives.ITextView textView)

Parameters​

context Avalonia.Media.DrawingContext

The drawing context.

textView Avalonia.Controls.Documents.Primitives.ITextView

The text view for coordinate mapping.

Properties​

NameDescription
IsVisibleGets or sets a value indicating whether this layer is currently visible.
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.
ZIndexGets the Z-index for rendering order (higher = on top).

IsVisible Property​

Gets or sets a value indicating whether this layer is currently visible.

public bool IsVisible { get; set; }

Name Property​

Gets 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.

public string Name { get; set; }

ZIndex Property​

Gets the Z-index for rendering order (higher = on top).

public int ZIndex { get; set; }

Events​

NameDescription
RegionsChangedEvent raised when regions change.

RegionsChanged Event​

Event raised when regions change.

public event EventHandler RegionsChanged