ITextViewHost Interface
Definition
Represents the host container for a text view, providing viewport and scrolling capabilities.
public interface ITextViewHost
Remarks
This interface separates viewport management (which belongs to the host container like RichTextEditor) from text rendering (which belongs to ITextView / TextViewBase). Typically implemented by controls that contain a ScrollViewer and a text view.
Methods
| Name | Description |
|---|---|
| BringRectIntoView | Scrolls to bring the specified rectangle into view. |
BringRectIntoView Method
Scrolls to bring the specified rectangle into view.
public bool BringRectIntoView(Avalonia.Rect rect)
Parameters
rect Avalonia.Rect
The rectangle to bring into view (in text view coordinates).
Returns
bool
True if scrolling occurred, false otherwise.
Properties
| Name | Description |
|---|---|
| Extent | Gets the extent (total content size). |
| Offset | Gets or sets the current scroll offset. |
| TextView | Gets the text view being hosted. |
| Viewport | Gets the viewport (visible area size). |
Extent Property
Gets the extent (total content size).
public Avalonia.Size Extent { get; set; }
Offset Property
Gets or sets the current scroll offset.
public Avalonia.Vector Offset { get; set; }
Remarks
When setting, the offset will be clamped to valid scroll bounds.
TextView Property
Gets the text view being hosted.
public Avalonia.Controls.Documents.Primitives.ITextView TextView { get; set; }
Viewport Property
Gets the viewport (visible area size).
public Avalonia.Size Viewport { get; set; }