Class RichTextDecorationLayer
- Namespace
- RichEdit.Maui
- Assembly
- RichEdit.Maui.dll
Owns one independently replaceable set of decorations for an editor.
public sealed class RichTextDecorationLayer : IDisposable
- Inheritance
-
RichTextDecorationLayer
- Implements
- Inherited Members
Remarks
Higher-priority layers override lower-priority layers. Equal priorities compose in creation order. Only specified properties override the preceding appearance.
Properties
Priority
Gets this layer's explicit composition priority.
public int Priority { get; }
Property Value
RequestGeneration
Gets the current request generation, including invalidation by clear, disposal, and document replacement.
public long RequestGeneration { get; }
Property Value
Methods
BeginUpdate()
Captures source identity and advances this producer's generation, invalidating earlier requests even if source is unchanged.
public DecorationRequest BeginUpdate()
Returns
Clear()
Removes all decorations in this layer.
public void Clear()
Dispose()
Removes this layer and restores the remaining presentation.
public void Dispose()
TryPublish(DecorationRequest, IEnumerable<RichTextDecoration>)
Publishes only if both this producer request and its source revision are still current.
public bool TryPublish(DecorationRequest request, IEnumerable<RichTextDecoration> decorations)
Parameters
requestDecorationRequestdecorationsIEnumerable<RichTextDecoration>
Returns
- bool
False for a stale, foreign, invalid, or disposed request.
TrySet(DocumentRevision, IEnumerable<RichTextDecoration>)
Replaces the layer atomically with ordered, non-overlapping ranges in the current document.
public bool TrySet(DocumentRevision revision, IEnumerable<RichTextDecoration> decorations)
Parameters
revisionDocumentRevisionThe source revision used to calculate these decorations.
decorationsIEnumerable<RichTextDecoration>The new decorations. Ranges are validated before any appearance changes.
Returns
- bool
False when the revision is stale, foreign, or invalid.