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: Bold, Italic, Underline, Strikethrough, Superscript, Subscript
- Font actions: FontFamily, FontSize, ForegroundColor, BackgroundColor
Use these instances in XAML with {x:Static editor:EditorActions.Bold} or
access them from code via EditorActions.Bold. Avalonia.Controls.Documents.Primitives.Actions.EditorActionIds
carries the matching Avalonia.Controls.Documents.Primitives.Actions.IEditorAction.Id for Avalonia.Controls.Documents.Primitives.Actions.EditorActions.GetById(string).
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, as an Avalonia.Controls.Documents.Primitives.Actions.EditorActionIds constant.
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, grouped by category in declaration order. |
| 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 Bold 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. |
| DeleteImage | Gets the Delete Image action (removes the selected inline image). |
| DeleteRow | Gets the Delete Row action. |
| DeleteTable | Gets the Delete Table action. |
| DifferentFirstPage | Gets the toggle that gives the document a first-page header and footer of its own. |
| DifferentOddAndEvenPages | Gets the toggle that gives the even pages a header and footer of their own. |
| FontFamily | Gets the Font Family action. |
| FontSize | Gets the Font Size action. |
| ForegroundColor | Gets the Foreground Color action. |
| GoToFooter | Gets the action that enters the footer of the caret's page, creating the document's running footer when the page shows none. |
| GoToFootnote | Gets the action that enters the note cited by the footnote anchor at the caret. |
| GoToFootnoteReference | Gets the action that leaves the note the caret is in for its anchor in the body. |
| GoToHeader | Gets the action that enters the header of the caret's page, creating the document's running header when the page shows none. |
| InsertColumnAfter | Gets the Insert Column After action. |
| InsertColumnBefore | Gets the Insert Column Before action. |
| InsertFootnote | Gets the action that inserts a footnote at the caret and enters the new note. |
| InsertImage | Gets the Insert Image action. |
| InsertPageCount | Gets the action that inserts a page-count field in the band the caret is in. |
| InsertPageNumber | Gets the action that inserts a page-number field in the band the caret is in. |
| InsertRowAfter | Gets the Insert Row After action. |
| InsertRowBefore | Gets the Insert Row Before action. |
| InsertTable | Gets the Insert Table action. |
| Italic | Gets the Italic action. |
| LineHeight | Gets the Line Height action. |
| LinkToPrevious | Gets the toggle that links the caret's section to the previous one's bands, or gives it bands of its own. |
| Margin | Gets the Margin action for block elements. |
| MergeCells | Gets the Merge Cells action. |
| 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. |
| RemoveFooter | Gets the action that removes the footer the caret is in or the caret's page shows. |
| RemoveHeader | Gets the action that removes the header the caret is in or the caret's page shows. |
| ReplaceImage | Gets the Replace Image action (swaps the selected image, keeping size/alt text). |
| ReturnToBody | Gets the action that leaves the band or note the caret is in for the body. |
| SelectAll | Gets the Select All action. |
| SplitCell | Gets the Split Cell action. |
| Strikethrough | Gets the Strikethrough action. |
| Subscript | Gets the Subscript action. |
| Superscript | Gets the Superscript 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 Underline 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, grouped by category in declaration order.
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 Bold 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; }
DeleteImage Property
Gets the Delete Image action (removes the selected inline image).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction DeleteImage { 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; }
DifferentFirstPage Property
Gets the toggle that gives the document a first-page header and footer of its own.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction DifferentFirstPage { get; set; }
DifferentOddAndEvenPages Property
Gets the toggle that gives the even pages a header and footer of their own.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction DifferentOddAndEvenPages { 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; }
GoToFooter Property
Gets the action that enters the footer of the caret's page, creating the document's running footer when the page shows none.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction GoToFooter { get; set; }
GoToFootnote Property
Gets the action that enters the note cited by the footnote anchor at the caret.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction GoToFootnote { get; set; }
GoToFootnoteReference Property
Gets the action that leaves the note the caret is in for its anchor in the body.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction GoToFootnoteReference { get; set; }
GoToHeader Property
Gets the action that enters the header of the caret's page, creating the document's running header when the page shows none.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction GoToHeader { 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; }
InsertFootnote Property
Gets the action that inserts a footnote at the caret and enters the new note.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertFootnote { get; set; }
InsertImage Property
Gets the Insert Image action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertImage { get; set; }
InsertPageCount Property
Gets the action that inserts a page-count field in the band the caret is in.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertPageCount { get; set; }
InsertPageNumber Property
Gets the action that inserts a page-number field in the band the caret is in.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction InsertPageNumber { 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 Italic 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.
LinkToPrevious Property
Gets the toggle that links the caret's section to the previous one's bands, or gives it bands of its own.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction LinkToPrevious { get; set; }
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.
MergeCells Property
Gets the Merge Cells action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction MergeCells { get; set; }
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; }
RemoveFooter Property
Gets the action that removes the footer the caret is in or the caret's page shows.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction RemoveFooter { get; set; }
RemoveHeader Property
Gets the action that removes the header the caret is in or the caret's page shows.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction RemoveHeader { get; set; }
ReplaceImage Property
Gets the Replace Image action (swaps the selected image, keeping size/alt text).
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction ReplaceImage { get; set; }
ReturnToBody Property
Gets the action that leaves the band or note the caret is in for the body.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction ReturnToBody { get; set; }
SelectAll Property
Gets the Select All action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction SelectAll { get; set; }
SplitCell Property
Gets the Split Cell action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction SplitCell { get; set; }
Strikethrough Property
Gets the Strikethrough action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Strikethrough { get; set; }
Subscript Property
Gets the Subscript action.
public Avalonia.Controls.Documents.Primitives.Actions.IEditorAction Subscript { get; set; }
Superscript Property
Gets the Superscript 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 Underline 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; }