Skip to main content

MarginAction Class

Definition

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

Action for setting uniform margin on block elements (Paragraph, Section, etc.).

public class MarginAction

Inheritance: BlockPropertyAction<Thickness> -> MarginAction

Remarks

Margin controls the spacing outside the block element's border. This action sets uniform margins on all four sides (top, right, bottom, left).

Common margin values:

  • 0 - No margin (flush with container)
  • 5 - Minimal spacing
  • 10 - Standard paragraph spacing
  • 15 - Moderate spacing
  • 20 - Large spacing for visual separation

When applied to a selection spanning multiple paragraphs, all affected paragraphs will have their margins set to the specified value.

Note: This action sets uniform margins only. For non-uniform margins (different values for each side), use a dedicated margin editor panel.

Constructors

NameDescription
MarginActionNo summary available.

MarginAction Constructor

public MarginAction()

Methods

NameDescription
GetAvailableValuesNo summary available.

GetAvailableValues Method

public System.Collections.Generic.IEnumerable<Avalonia.Thickness> GetAvailableValues()

Returns

System.Collections.Generic.IEnumerable<Avalonia.Thickness>

Properties

NameDescription
DisplayNameNo summary available.
GestureNo summary available.
IdNo summary available.

DisplayName Property

public string DisplayName { get; set; }

Gesture Property

public Avalonia.Input.KeyGesture Gesture { get; set; }

Id Property

public string Id { get; set; }