EditorActions Class
Definition
Provides singleton instances of all built-in editor actions.
public class EditorActions
Remarks
Actions are organized by category:
- Edit actions: Undo, Redo, Cut, Copy, Paste, SelectAll
- Format actions: RichBold, RichItalic, RichUnderline, Strikethrough, RichSuperscript, RichSubscript
- Font actions: FontFamily, FontSize, ForegroundColor, BackgroundColor
Use these instances in XAML with {x:Static editor:EditorActions.RichBold} or
access them from code via EditorActions.RichBold.
Methods
| Name | Description |
|---|---|
| GetById | Gets an action by its unique identifier. |
GetById Method
Gets an action by its unique identifier.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction GetById(string id)
Parameters
id string
The action ID (e.g., "Format.RichBold").
Returns
Avalonia.Controls.Documents.Primitives.Actions.IEditorAction
The action if found; otherwise, null.
Properties
| Name | Description |
|---|---|
| AlignCenter | Gets the Align Center action. |
| AlignJustify | Gets the Justify action. |
| AlignLeft | Gets the Align Left action. |
| AlignRight | Gets the Align Right action. |
| All | Gets all built-in actions. |
| BackgroundColor | Gets the Background Color action. |
| BlockBackground | Gets the Block Background action for block elements. |
| BlockBorder | Gets the Block Border toggle action. |
| Bold | Gets the RichBold action. |
| BorderBrush | Gets the Border Brush (color) action for block elements. |
| BorderThickness | Gets the Border Thickness action for block elements. |
| BulletMarkerStyle | Gets the Bullet Marker Style action (changes marker symbol on bullet lists). |
| Copy | Gets the Copy action. |
| Cut | Gets the Cut action. |
| DeleteColumn | Gets the Delete Column action. |
| DeleteRow | Gets the Delete Row action. |
| DeleteTable | Gets the Delete Table action. |
| FontFamily | Gets the Font Family action. |
| FontSize | Gets the Font Size action. |
| ForegroundColor | Gets the Foreground Color action. |
| InsertColumnAfter | Gets the Insert Column After action. |
| InsertColumnBefore | Gets the Insert Column Before action. |
| InsertRowAfter | Gets the Insert Row After action. |
| InsertRowBefore | Gets the Insert Row Before action. |
| InsertTable | Gets the Insert Table action. |
| Italic | Gets the RichItalic action. |
| LineHeight | Gets the Line Height action. |
| Margin | Gets the Margin action for block elements. |
| NumberedMarkerStyle | Gets the Numbered Marker Style action (changes marker symbol on numbered lists). |
| Padding | Gets the Padding action for block elements. |
| Paste | Gets the Paste action. |
| PasteUnformatted | Gets the Paste Without Formatting action (Ctrl+Shift+V). |
| Redo | Gets the Redo action. |
| SelectAll | Gets the Select All action. |
| Strikethrough | Gets the Strikethrough action. |
| Subscript | Gets the RichSubscript action. |
| Superscript | Gets the RichSuperscript action. |
| TextAlignmentAction | Gets the Text Alignment action (Left, Center, Right, Justify). |
| ToggleBulletList | Gets the Toggle Bullet List action (wraps/unwraps paragraphs as an unordered list). |
| ToggleNumberedList | Gets the Toggle Numbered List action (wraps/unwraps paragraphs as an ordered list). |
| Underline | Gets the RichUnderline action. |
| Undo | Gets the Undo action. |
AlignCenter Property
Gets the Align Center action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction AlignCenter { get; set; }
AlignJustify Property
Gets the Justify action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction AlignJustify { get; set; }
AlignLeft Property
Gets the Align Left action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction AlignLeft { get; set; }
AlignRight Property
Gets the Align Right action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction AlignRight { get; set; }
All Property
Gets all built-in actions.
public System.Collections.Generic.IEnumerable<Avalonia.Controls.Documents.Primitives.Actions.IEditorAction> All { get; set; }
BackgroundColor Property
Gets the Background Color action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction BackgroundColor { get; set; }
BlockBackground Property
Gets the Block Background action for block elements.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction BlockBackground { get; set; }
Remarks
Sets the background color for entire paragraphs or sections. Works with Avalonia.Controls.Documents.Primitives.Toolbar.ColorPickerTool for color selection.
Different from inline text background (RichRun.Background) - fills the entire block area including padding.
Combine with Padding and BorderBrush to create callout boxes.
BlockBorder Property
Gets the Block Border toggle action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction BlockBorder { get; set; }
Bold Property
Gets the RichBold action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Bold { get; set; }
BorderBrush Property
Gets the Border Brush (color) action for block elements.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction BorderBrush { get; set; }
Remarks
Sets the border color for paragraphs or sections. Works with Avalonia.Controls.Documents.Primitives.Toolbar.ColorPickerTool for color selection.
Note: Border won't be visible without also setting BorderThickness (width). Combine with BlockBackground and Padding to create outlined callout boxes.
BorderThickness Property
Gets the Border Thickness action for block elements.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction BorderThickness { get; set; }
Remarks
Sets uniform border thickness (width) on all four sides. Common values: 0, 1, 2, 3 pixels.
Note: Border won't be visible without also setting BorderBrush (color). For non-uniform borders, use a dedicated border editor panel.
BulletMarkerStyle Property
Gets the Bullet Marker Style action (changes marker symbol on bullet lists).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction BulletMarkerStyle { get; set; }
Copy Property
Gets the Copy action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Copy { get; set; }
Cut Property
Gets the Cut action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Cut { get; set; }
DeleteColumn Property
Gets the Delete Column action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction DeleteColumn { get; set; }
DeleteRow Property
Gets the Delete Row action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction DeleteRow { get; set; }
DeleteTable Property
Gets the Delete Table action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction DeleteTable { get; set; }
FontFamily Property
Gets the Font Family action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction FontFamily { get; set; }
FontSize Property
Gets the Font Size action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction FontSize { get; set; }
ForegroundColor Property
Gets the Foreground Color action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction ForegroundColor { get; set; }
InsertColumnAfter Property
Gets the Insert Column After action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertColumnAfter { get; set; }
InsertColumnBefore Property
Gets the Insert Column Before action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertColumnBefore { get; set; }
InsertRowAfter Property
Gets the Insert Row After action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertRowAfter { get; set; }
InsertRowBefore Property
Gets the Insert Row Before action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertRowBefore { get; set; }
InsertTable Property
Gets the Insert Table action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertTable { get; set; }
Italic Property
Gets the RichItalic action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Italic { get; set; }
LineHeight Property
Gets the Line Height action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction LineHeight { get; set; }
Remarks
Line height is a block-level property that controls vertical spacing between lines. Important: Uses absolute pixel/point values, not relative multipliers.
Common values: 14, 16, 18, 20, 24, 28, 32 pixels.
Margin Property
Gets the Margin action for block elements.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Margin { get; set; }
Remarks
Sets uniform margin (spacing outside the block) on all four sides. Common values: 0, 5, 10, 15, 20 pixels.
For non-uniform margins, use a dedicated margin editor panel.
NumberedMarkerStyle Property
Gets the Numbered Marker Style action (changes marker symbol on numbered lists).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction NumberedMarkerStyle { get; set; }
Padding Property
Gets the Padding action for block elements.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Padding { get; set; }
Remarks
Sets uniform padding (spacing inside the block, between border and content) on all four sides. Common values: 0, 5, 10, 15, 20 pixels.
Useful when combined with borders or backgrounds to create callout boxes. For non-uniform padding, use a dedicated padding editor panel.
Paste Property
Gets the Paste action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Paste { get; set; }
PasteUnformatted Property
Gets the Paste Without Formatting action (Ctrl+Shift+V).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction PasteUnformatted { get; set; }
Redo Property
Gets the Redo action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Redo { get; set; }
SelectAll Property
Gets the Select All action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction SelectAll { get; set; }
Strikethrough Property
Gets the Strikethrough action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Strikethrough { get; set; }
Subscript Property
Gets the RichSubscript action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Subscript { get; set; }
Superscript Property
Gets the RichSuperscript action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Superscript { get; set; }
TextAlignmentAction Property
Gets the Text Alignment action (Left, Center, Right, Justify).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction TextAlignmentAction { get; set; }
Remarks
Text alignment is a block-level property that applies to paragraphs and sections. When applied to a selection spanning multiple paragraphs, all affected paragraphs will have their alignment set to the specified value.
ToggleBulletList Property
Gets the Toggle Bullet List action (wraps/unwraps paragraphs as an unordered list).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction ToggleBulletList { get; set; }
ToggleNumberedList Property
Gets the Toggle Numbered List action (wraps/unwraps paragraphs as an ordered list).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction ToggleNumberedList { get; set; }
Underline Property
Gets the RichUnderline action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Underline { get; set; }
Undo Property
Gets the Undo action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Undo { get; set; }