BlockBackgroundAction Class
Definition
Action for setting background color on block elements (Paragraph, Section, etc.).
public class BlockBackgroundAction
Remarks
Block background is different from inline text background (RichRun.Background). It fills the entire block area including padding, making it useful for:
- Highlighting important paragraphs
- Creating visual separation between sections
- Building callout boxes and notes
- Color-coding content
This action is designed to work with Avalonia.Controls.Documents.Primitives.Toolbar.ColorPickerTool. It returns null for available values, indicating the UI should use a color picker instead of a dropdown with predefined values.
When applied to a selection spanning multiple paragraphs, all affected paragraphs will have their background set to the specified color.
Tip: Combine with Avalonia.Controls.Documents.Primitives.Actions.PaddingAction and Avalonia.Controls.Documents.Primitives.Actions.BorderBrushAction to create visually distinct content blocks.
Constructors
| Name | Description |
|---|---|
| BlockBackgroundAction | No summary available. |
BlockBackgroundAction Constructor
public BlockBackgroundAction()
Methods
| Name | Description |
|---|---|
| GetAvailableValues | No summary available. |
GetAvailableValues Method
public System.Collections.Generic.IEnumerable<Avalonia.Media.IBrush> GetAvailableValues()
Returns
System.Collections.Generic.IEnumerable<Avalonia.Media.IBrush>
Properties
| Name | Description |
|---|---|
| DisplayName | No summary available. |
| Gesture | No summary available. |
| Id | No 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; }