Skip to main content

HighlightRegion Class

Definition​

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

Represents a region of text to be highlighted.

public class HighlightRegion

Inheritance: object -> HighlightRegion

Constructors​

NameDescription
HighlightRegionInitializes a new instance of the Avalonia.Controls.Documents.Primitives.Highlighting.HighlightRegion class.

HighlightRegion Constructor​

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

public HighlightRegion(Avalonia.Controls.Documents.TextModel.TextPointer start, Avalonia.Controls.Documents.TextModel.TextPointer end, Avalonia.Media.IBrush brush, double opacity, Avalonia.Controls.Documents.Primitives.Highlighting.HighlightStyle style)

Parameters​

start Avalonia.Controls.Documents.TextModel.TextPointer

The start position of the highlight region.

end Avalonia.Controls.Documents.TextModel.TextPointer

The end position of the highlight region.

brush Avalonia.Media.IBrush

The brush to use for highlighting.

opacity double

The opacity of the highlight (0.0 to 1.0).

style Avalonia.Controls.Documents.Primitives.Highlighting.HighlightStyle

The style of highlight.

Properties​

NameDescription
BrushGets or sets the brush to use for highlighting.
EndGets the end position of the highlight region.
OpacityGets or sets the opacity of the highlight (0.0 to 1.0).
PenGets or sets the optional pen for underline/strikethrough.
StartGets the start position of the highlight region.
StyleGets or sets the style of highlight (background, underline, etc.).
TagGets or sets custom data associated with this region.

Brush Property​

Gets or sets the brush to use for highlighting.

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

End Property​

Gets the end position of the highlight region.

public Avalonia.Controls.Documents.TextModel.TextPointer End { get; set; }

Opacity Property​

Gets or sets the opacity of the highlight (0.0 to 1.0).

public double Opacity { get; set; }

Pen Property​

Gets or sets the optional pen for underline/strikethrough.

public Avalonia.Media.IPen Pen { get; set; }

Start Property​

Gets the start position of the highlight region.

public Avalonia.Controls.Documents.TextModel.TextPointer Start { get; set; }

Style Property​

Gets or sets the style of highlight (background, underline, etc.).

public Avalonia.Controls.Documents.Primitives.Highlighting.HighlightStyle Style { get; set; }

Tag Property​

Gets or sets custom data associated with this region.

public object Tag { get; set; }