Skip to main content

EditorActions Class

Definition​

Assembly:Avalonia.Controls.RichTextEditor
Package:Avalonia.Controls.RichTextEditor

Provides singleton instances of all built-in editor actions.

public class EditorActions

Inheritance: object -> 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​

NameDescription
GetByIdGets 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​

NameDescription
AlignCenterGets the Align Center action.
AlignJustifyGets the Justify action.
AlignLeftGets the Align Left action.
AlignRightGets the Align Right action.
AllGets all built-in actions, grouped by category in declaration order.
BackgroundColorGets the Background Color action.
BlockBackgroundGets the Block Background action for block elements.
BlockBorderGets the Block Border toggle action.
BoldGets the Bold action.
BorderBrushGets the Border Brush (color) action for block elements.
BorderThicknessGets the Border Thickness action for block elements.
BulletMarkerStyleGets the Bullet Marker Style action (changes marker symbol on bullet lists).
CopyGets the Copy action.
CutGets the Cut action.
DeleteColumnGets the Delete Column action.
DeleteImageGets the Delete Image action (removes the selected inline image).
DeleteRowGets the Delete Row action.
DeleteTableGets the Delete Table action.
DifferentFirstPageGets the toggle that gives the document a first-page header and footer of its own.
DifferentOddAndEvenPagesGets the toggle that gives the even pages a header and footer of their own.
FontFamilyGets the Font Family action.
FontSizeGets the Font Size action.
ForegroundColorGets the Foreground Color action.
GoToFooterGets the action that enters the footer of the caret's page, creating the document's running footer when the page shows none.
GoToFootnoteGets the action that enters the note cited by the footnote anchor at the caret.
GoToFootnoteReferenceGets the action that leaves the note the caret is in for its anchor in the body.
GoToHeaderGets the action that enters the header of the caret's page, creating the document's running header when the page shows none.
InsertColumnAfterGets the Insert Column After action.
InsertColumnBeforeGets the Insert Column Before action.
InsertFootnoteGets the action that inserts a footnote at the caret and enters the new note.
InsertImageGets the Insert Image action.
InsertPageCountGets the action that inserts a page-count field in the band the caret is in.
InsertPageNumberGets the action that inserts a page-number field in the band the caret is in.
InsertRowAfterGets the Insert Row After action.
InsertRowBeforeGets the Insert Row Before action.
InsertTableGets the Insert Table action.
ItalicGets the Italic action.
LineHeightGets the Line Height action.
LinkToPreviousGets the toggle that links the caret's section to the previous one's bands, or gives it bands of its own.
MarginGets the Margin action for block elements.
MergeCellsGets the Merge Cells action.
NumberedMarkerStyleGets the Numbered Marker Style action (changes marker symbol on numbered lists).
PaddingGets the Padding action for block elements.
PasteGets the Paste action.
PasteUnformattedGets the Paste Without Formatting action (Ctrl+Shift+V).
RedoGets the Redo action.
RemoveFooterGets the action that removes the footer the caret is in or the caret's page shows.
RemoveHeaderGets the action that removes the header the caret is in or the caret's page shows.
ReplaceImageGets the Replace Image action (swaps the selected image, keeping size/alt text).
ReturnToBodyGets the action that leaves the band or note the caret is in for the body.
SelectAllGets the Select All action.
SplitCellGets the Split Cell action.
StrikethroughGets the Strikethrough action.
SubscriptGets the Subscript action.
SuperscriptGets the Superscript action.
TextAlignmentActionGets the Text Alignment action (Left, Center, Right, Justify).
ToggleBulletListGets the Toggle Bullet List action (wraps/unwraps paragraphs as an unordered list).
ToggleNumberedListGets the Toggle Numbered List action (wraps/unwraps paragraphs as an ordered list).
UnderlineGets the Underline action.
UndoGets 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; }