IToggleAction Interface
Definition
Represents an action that has an on/off state.
public interface IToggleAction
Remarks
Toggle actions are used for formatting commands like RichBold, RichItalic, and RichUnderline. The Avalonia.Controls.Documents.Primitives.Actions.IToggleAction.IsChecked(Avalonia.Controls.Documents.Primitives.ITextEditorHost) property reflects whether the formatting is currently applied to the selection.
Methods
| Name | Description |
|---|---|
| IsChecked | Gets whether the action is currently "on" for the selection. |
IsChecked Method
Gets whether the action is currently "on" for the selection.
public bool IsChecked(Avalonia.Controls.Documents.Primitives.ITextEditorHost host)
Parameters
host Avalonia.Controls.Documents.Primitives.ITextEditorHost
The editor host to query.
Returns
bool
True if the toggle state is on; otherwise, false.
Remarks
For formatting actions, this returns true if all text in the selection has the formatting applied.