MentorAgent Docs
Menu

Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.

ReferencePackage: Novior.MentorAgent.Blazor

WasmMentorPageContext class

The WasmMentorPageContext class of Novior.MentorAgent.Blazor.Services: WASM implementation of IMentorPageContext. Maintains page context locally and provides…

On this page

WASM implementation of IMentorPageContext. Maintains page context locally and provides WasmMentorPageContext.BuildSnapshot to serialize it for transmission to the server hub.

Namespace: Novior.MentorAgent.Blazor.Services. Package: Novior.MentorAgent.Blazor.

public sealed class WasmMentorPageContext : IMentorPageContext

Implements IMentorPageContext.

Terminal
dotnet add package Novior.MentorAgent.Blazor

public WasmMentorPageContext()

public IReadOnlyDictionary<string, object?> ContextData { get; }

public string? PageName { get; }

public IReadOnlyDictionary<string, UIActionRegistration> UIActions { get; }

public PageContextSnapshot BuildSnapshot()

Builds a serializable snapshot of the current page context for the server.

public void Clear()

public void Clear(string pageName)

public IMentorPageContext RegisterUIAction(string actionName, string description, Action<object?> handler)

public IMentorPageContext RegisterUIAction<TParam>(string actionName, string description, Action<TParam?> handler, string? parameterHint = null)

public IMentorPageContext RegisterUIActionAsync(string actionName, string description, Func<object?, Task> handler, string? parameterHint = null)

public IMentorPageContext RegisterUIActionAsync<TParam>(string actionName, string description, Func<TParam?, Task> handler, string? parameterHint = null)

public IMentorPageContext Remove(string key)

public IMentorPageContext Set(string key, object? value)

public IMentorPageContext SetPageName(string pageName)

public IMentorPageContext SignalReady()

public IMentorPageContext UnregisterUIAction(string actionName)

public Task<bool> WaitForPageReadyAsync(int timeoutMs = 2000, CancellationToken ct = default)