Docsv3.20.2
Back to API Reference
Interface

IFormatStyleSource

abstract

Source of the style a formatting command toggles. Applies a style already configured on the component, in that style's own markup syntax — it never creates or registers anything, so a field that has no matching style offers nothing to toggle. ReferencedStyle addresses by modifier type. Implement to add a custom resolution.

Implementations(1)

Types that implement IFormatStyleSource.

public string Label{ get }

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

public virtual bool CanToggle()

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

public virtual bool IsActive()

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

public virtual bool Matches()

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 abstract bool Toggle()

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.