Docs · API reference · Verso.Abstractions

IPanelInteractionHandler Interface#

Capability interface for extensions that handle user actions raised from a panel owned by the same extension. Implement alongside an INotebookPanel on the same class (the common case) or as a sibling class that shares the panel's PanelId. Routing is by the (ExtensionId, PanelId) identity pair.

public interface IPanelInteractionHandler : Verso.Abstractions.IExtension

Implements IExtension

Properties#

PanelId Property#

The PanelId this handler services. The handler's ExtensionId supplies the other half of the identity pair. The handler's owning extension must also register an INotebookPanel with this same PanelId.

string PanelId { get; }

Property Value#

System.String

Methods#

OnPanelInteractionAsync(PanelInteractionContext) Method#

Invoked when the host reports that the user triggered an action in the panel. Implementations should update their own state and call RequestRefresh when the panel's content has changed as a result.

System.Threading.Tasks.Task OnPanelInteractionAsync(Verso.Abstractions.PanelInteractionContext context);

Parameters#

context PanelInteractionContext

Describes the action that was triggered.

Returns#

System.Threading.Tasks.Task

Remarks#

How a host detects an action is the host's business and varies by host. Interaction types in the verso/ namespace are reserved by the host and are intercepted before this handler is invoked, so using that prefix as an application-defined type will silently never reach the handler.