Edit

AnonymousCommand Constructors

AnonymousCommand(Action) Constructor

Definition

Namespace: Microsoft.CommandPalette.Extensions.Toolkit

Initializes a new instance of the AnonymousCommand class with an action parameter.

public AnonymousCommand(Action? action)
    {
        Name = "Invoke";
        _action = action;
    }

Parameters

action Action

The action to be executed when the command is invoked. This parameter is optional and can be null.