Skip to content

TextEditorSession class

Editing state layered over EditableTextDocument.

public sealed class TextEditorSession
name description
TextEditorSession(…)
AnchorPosition { get; }
CanRedo { get; }
CanUndo { get; }
CaretPosition { get; }
Document { get; }
EditableRegions { get; set; } Consulted before every edit. Null leaves the document fully editable.
IsComposing { get; }
Selection { get; }
event StateChanged
event TextCommitted Raised after typed or composed text reached the document, once per commit.
Backspace(…)
BeginComposition()
CancelComposition()
ClearHistory()
CommitComposition()
Delete(…)
EnterText(…) Applies typed text and reports it once it is in the document. (2 methods)
MoveLogical(…)
Redo()
ReplaceRange(…) Replaces a document range the way a programmatic edit does: the caret and selection ride along with the surrounding text instead of landing on the edit, and the change stays undoable. Editable-region policy is not consulted, which is the caller’s to enforce.
ReplaceSelection(…)
SelectAll()
SelectWordAt(…)
SetCaret(…)
SetSelection(…)
Undo()
UpdateComposition(…)