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

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).