Class RichTextLayout
- Namespace
- RichEdit.Maui
- Assembly
- RichEdit.Maui.dll
Queries visible native geometry on the editor's UI thread.
public sealed class RichTextLayout
- Inheritance
-
RichTextLayout
- Inherited Members
Methods
Capture()
Captures visible metadata, or null when no reconciled native layout is available.
public RichTextLayoutSnapshot? Capture()
Returns
- RichTextLayoutSnapshot
An immutable layout capture.
CaptureInput()
Captures native input layout, including this view's provisional marked text.
public RichTextLayoutSnapshot? CaptureInput()
Returns
- RichTextLayoutSnapshot
A capture whose provisional positions address CompositionSnapshot, or null before usable layout.
CreateRelativeTo(View)
Creates a facade in an ancestor view's coordinates, for composed controls.
public RichTextLayout CreateRelativeTo(View ancestor)
Parameters
ancestorViewAn ancestor of the text view in the MAUI visual tree.
Returns
- RichTextLayout
A layout service that translates captures and pointer hit tests to that ancestor.
GetCaretBounds(RichTextLayoutSnapshot, int, RichTextCaretAffinity)
Gets a visible caret rectangle without moving the caret.
public Rect? GetCaretBounds(RichTextLayoutSnapshot layout, int position, RichTextCaretAffinity affinity = RichTextCaretAffinity.Downstream)
Parameters
layoutRichTextLayoutSnapshotA current capture from this service.
positionintThe UTF-16 source boundary.
affinityRichTextCaretAffinityWhich side of a wrap or bidirectional boundary to use.
Returns
- Rect?
A visible caret rectangle, or null.
GetCaretBounds(RichTextLayoutSnapshot, TextSelection)
Gets the active caret rectangle, including unmaterialized virtual spaces measured by the native font.
public Rect? GetCaretBounds(RichTextLayoutSnapshot layout, TextSelection selection)
Parameters
layoutRichTextLayoutSnapshotselectionTextSelection
Returns
- Rect?
GetRangeBounds(RichTextLayoutSnapshot, TextSpan)
Gets separate visible rectangles for a source range, including wraps and bidi fragments.
public IReadOnlyList<Rect> GetRangeBounds(RichTextLayoutSnapshot layout, TextSpan range)
Parameters
layoutRichTextLayoutSnapshotA current capture from this service.
rangeTextSpanThe bounded source range. Empty ranges use downstream caret geometry.
Returns
- IReadOnlyList<Rect>
Visible rectangles, or an empty collection.
HitTest(RichTextLayoutSnapshot, Point)
Hit-tests a local point without changing source, selection, scrolling, or folding.
public RichTextHit? HitTest(RichTextLayoutSnapshot layout, Point point)
Parameters
layoutRichTextLayoutSnapshotA current capture from this service.
pointPointA point in the same coordinate space as the capture.
Returns
- RichTextHit
A source/adornment hit, or null outside the visible editor or for a stale capture.
Events
Changed
Occurs after layout, viewport, appearance, attachment, or source changes.
public event EventHandler? Changed