Back to API Reference
Class

TextFormattingBehavior

sealed
Inherits:InputBehavior

User-driven formatting commands, each binding a style source (IFormatStyleSource) to an optional primary-modifier shortcut (Ctrl on Windows/Linux, Cmd on macOS). A command toggles its style on the selection, or as a typing style at a collapsed caret (ToggleStyle<T> semantics), in the syntax the resolved style's rule speaks. Toolbar buttons and context menus call Toggle / Toggle; button state comes from IsStyleActive<T> via CaretContextBehavior. Default commands: bold (B), italic (I), underline (U), clear formatting (\).

Nested Types

public NativeKeyCode ClearFormattingKey{ get; set }

Primary-modifier shortcut that clears formatting; None disables it.

public MarkupVisibility MarkupVisibility{ get; set }

How authored markup characters are exposed while editing.

public bool RichPaste{ get; set }

Whether structured clipboard formatting is accepted on paste.

public PlainTextPastePolicy PlainTextPaste{ get; set }

How plain clipboard text is interpreted by the markup parser.

public TypingMarkupPolicy TypingMarkup{ get; set }

Whether markup typed by the user is parsed or inserted literally.

public bool ArrowKeyEscape{ get; set }

Whether a repeated outward arrow clears retained typing formatting.

protected override void OnEnable()
protected override void OnDisable()
public bool Toggle()

Toggles the command at index. Returns whether the style is now on.

public bool Toggle()

Toggles the command named name (case-insensitive).