Docsv3.31.0
Back to API Reference
Class

ReferencedStyle

sealed
Implements:IFormatStyleSourceIModifierChangeSink

Toggles whichever style the component carries for the chosen modifier type, in that style's own markup syntax. The optional parameter is passed to the rule, so a parameterised rule (an XML-like tag) writes it into the markup. Several styles share a modifier type — the first in resolution order wins.

public BaseModifier Modifier{ get; set }

Modifier signature used to resolve the configured component style.

public string Parameter{ get; set }

Optional markup parameter passed when the style is toggled.

public string Label{ get }

Label of the style for menus and buttons, such as "Bold"; null while the source names no style, as it does unless implemented.

public bool CanToggle(UniTextEditable editable)

Whether editable carries a style this source can toggle; true unless implemented.

public bool IsActive(UniTextEditable editable)

Whether the style is on across the selection, or as the pending typing style at a caret; false unless implemented.

public bool Matches(IFormatStyleSource other)

Whether other toggles the same style, as a menu matches a control of a style toggle's own; unless implemented, a source of the same type with the same Label.

public bool Toggle(UniTextEditable editable)

Toggles the style on the selection (or the pending typing style at a caret). Returns whether it is now on.

public Action Changed

Raised after configuration changes that can affect the resolved or emitted style. Mutable custom implementations must raise this for every such change so an owning formatting behavior can reconcile.