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.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Blazor.Services. Package: Novior.MentorAgent.Blazor.
public sealed class WasmMentorPageContext : IMentorPageContext
Implements IMentorPageContext.
dotnet add package Novior.MentorAgent.BlazorConstructors
Section titled “Constructors”public WasmMentorPageContext()
Properties
Section titled “Properties”ContextData
Section titled “ContextData”public IReadOnlyDictionary<string, object?> ContextData { get; }
PageName
Section titled “PageName”public string? PageName { get; }
UIActions
Section titled “UIActions”public IReadOnlyDictionary<string, UIActionRegistration> UIActions { get; }
Methods
Section titled “Methods”BuildSnapshot
Section titled “BuildSnapshot”public PageContextSnapshot BuildSnapshot()
Builds a serializable snapshot of the current page context for the server.
public void Clear()
public void Clear(string pageName)
RegisterUIAction
Section titled “RegisterUIAction”public IMentorPageContext RegisterUIAction(string actionName, string description, Action<object?> handler)
public IMentorPageContext RegisterUIAction<TParam>(string actionName, string description, Action<TParam?> handler, string? parameterHint = null)
RegisterUIActionAsync
Section titled “RegisterUIActionAsync”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)
Remove
Section titled “Remove”public IMentorPageContext Remove(string key)
public IMentorPageContext Set(string key, object? value)
SetPageName
Section titled “SetPageName”public IMentorPageContext SetPageName(string pageName)
SignalReady
Section titled “SignalReady”public IMentorPageContext SignalReady()
UnregisterUIAction
Section titled “UnregisterUIAction”public IMentorPageContext UnregisterUIAction(string actionName)
WaitForPageReadyAsync
Section titled “WaitForPageReadyAsync”public Task<bool> WaitForPageReadyAsync(int timeoutMs = 2000, CancellationToken ct = default)
