# WasmMentorPageContext class

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

- URL: https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentorpagecontext
- Verified with: MentorAgent 1.2.0
- Last updated: 2026-10-27
- Packages: Novior.MentorAgent.Blazor

WASM implementation of [`IMentorPageContext`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentorpagecontext). Maintains page context locally and provides [`WasmMentorPageContext.BuildSnapshot`](https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentorpagecontext#buildsnapshot) to serialize it for transmission to the server hub.

## Definition

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

`public sealed class WasmMentorPageContext : IMentorPageContext`

Implements [`IMentorPageContext`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentorpagecontext).

```shell
dotnet add package Novior.MentorAgent.Blazor
```

## Constructors

`public WasmMentorPageContext()`

## Properties

### `ContextData`

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

### `PageName`

`public string? PageName { get; }`

### `UIActions`

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

## Methods

### `BuildSnapshot`

`public PageContextSnapshot BuildSnapshot()`

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

### `Clear`

`public void Clear()`

`public void Clear(string pageName)`

### `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`

`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`

`public IMentorPageContext Remove(string key)`

### `Set`

`public IMentorPageContext Set(string key, object? value)`

### `SetPageName`

`public IMentorPageContext SetPageName(string pageName)`

### `SignalReady`

`public IMentorPageContext SignalReady()`

### `UnregisterUIAction`

`public IMentorPageContext UnregisterUIAction(string actionName)`

### `WaitForPageReadyAsync`

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

---

- Previous: [WasmMentorOrchestrator class](https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentororchestrator.md)
- Next: [WasmMentorStateService class](https://docs.mentoragent.net/api/novior-mentoragent-blazor-services/wasmmentorstateservice.md)
