Skip to main content

DeleteImageAction Class

Definition

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

Deletes the inline Avalonia.Controls.Documents.RichImage at the current selection or caret.

public class DeleteImageAction

Inheritance: object -> EditorAction -> DeleteImageAction

Remarks

Enabled only when an image is the current context (see Avalonia.Controls.Documents.Primitives.BlockContextResolver.GetContextImage(Avalonia.Controls.Documents.Primitives.ITextEditorHost)). Deleting and undoing restores the image whole. Removal goes through Avalonia.Controls.Documents.TextModel.TextDocument.DeleteNode(Avalonia.Controls.Documents.TextModel.TextDocumentNode) so the image node is detached cleanly — a character-range delete would strip the object character but leave a zero-length orphan node behind.

Constructors

NameDescription
DeleteImageActionNo summary available.

DeleteImageAction Constructor

public DeleteImageAction()

Methods

NameDescription
CanExecuteNo summary available.
ExecuteNo summary available.
ExecuteAsyncExecutes the action asynchronously. Inherited from EditorAction.
GetStateGets the current state of the action. Inherited from EditorAction.

CanExecute Method

public bool CanExecute(Avalonia.Controls.Documents.Primitives.ITextEditorHost host)

Parameters

host Avalonia.Controls.Documents.Primitives.ITextEditorHost

Returns

bool

Execute Method

public void Execute(Avalonia.Controls.Documents.Primitives.ITextEditorHost host)

Parameters

host Avalonia.Controls.Documents.Primitives.ITextEditorHost

Properties

NameDescription
DisplayNameNo summary available.
GestureGets the optional keyboard gesture for this action. Inherited from EditorAction.
IdNo summary available.

DisplayName Property

public string DisplayName { get; set; }

Id Property

public string Id { get; set; }