TextChangeEventArgs Class
Definition
Raised after a single text change is applied (via Avalonia.Controls.Documents.TextModel.TextDocument.TextChanged event). Multiple text changes may fire within one Avalonia.Controls.Documents.TextModel.TextDocument.BeginChange scope; consumers that want a per-commit view should subscribe to Avalonia.Controls.Documents.TextModel.TextDocument.Changed instead.
public class TextChangeEventArgs
Properties
| Name | Description |
|---|---|
| InsertedText | Gets the inserted text as a zero-copy view into the rope. Empty for pure deletions. May be shorter than Avalonia.Controls.Documents.TextModel.TextChangeEventArgs.NewLength when the inserted range crosses a rope-leaf boundary; callers that need the full string should call ReadOnlyMemory<T>.ToString or read from Avalonia.Controls.Documents.TextModel.TextDocument directly. |
| Kind | Gets the kind of change (Insert, Delete, or Replace). |
| NewLength | Gets the length of text that was inserted (0 for pure deletions). |
| Offset | Gets the offset where the change occurred. |
| OldLength | Gets the length of text that was deleted (0 for pure insertions). |
InsertedText Property
Gets the inserted text as a zero-copy view into the rope. Empty for pure deletions. May be shorter than Avalonia.Controls.Documents.TextModel.TextChangeEventArgs.NewLength when the inserted range crosses a rope-leaf boundary; callers that need the full string should call ReadOnlyMemory<T>.ToString or read from Avalonia.Controls.Documents.TextModel.TextDocument directly.
public ReadOnlyMemory<char> InsertedText { get; set; }
Kind Property
Gets the kind of change (Insert, Delete, or Replace).
public Avalonia.Controls.Documents.TextModel.DocumentChangeKind Kind { get; set; }
NewLength Property
Gets the length of text that was inserted (0 for pure deletions).
public int NewLength { get; set; }
Offset Property
Gets the offset where the change occurred.
public int Offset { get; set; }
OldLength Property
Gets the length of text that was deleted (0 for pure insertions).
public int OldLength { get; set; }