formaui-net.Framework.State.WebView
1.0.0-preview.27
Prefix Reserved
dotnet add package formaui-net.Framework.State.WebView --version 1.0.0-preview.27
NuGet\Install-Package formaui-net.Framework.State.WebView -Version 1.0.0-preview.27
<PackageReference Include="formaui-net.Framework.State.WebView" Version="1.0.0-preview.27" />
<PackageVersion Include="formaui-net.Framework.State.WebView" Version="1.0.0-preview.27" />
<PackageReference Include="formaui-net.Framework.State.WebView" />
paket add formaui-net.Framework.State.WebView --version 1.0.0-preview.27
#r "nuget: formaui-net.Framework.State.WebView, 1.0.0-preview.27"
#:package formaui-net.Framework.State.WebView@1.0.0-preview.27
#addin nuget:?package=formaui-net.Framework.State.WebView&version=1.0.0-preview.27&prerelease
#tool nuget:?package=formaui-net.Framework.State.WebView&version=1.0.0-preview.27&prerelease
Forma.Framework.State.WebView
Synchronizes a shared state value across an application's web views, as the culture's and the theme's coordinators do in a Blazor Hybrid application. A joining web view receives the value the application currently holds. Each participating web view follows subsequent accepted values on its own UI thread. If several values arrive before its document starts following, the document applies the latest pending value when following begins.
Changes are accepted one at a time, each numbered in the synchronizer's sequence. It holds the rules the page state synchronizer holds in the browser, which the culture design sets out, for an application whose web views have no server between them.
Install
The package comes with the Blazor Hybrid halves built on it, such as formaui-net.Framework.Culture.Blazor.WebView, so
a host references it directly only to synchronize a value of its own.
dotnet add package formaui-net.Framework.State.WebView --prerelease
Use it
A value's application coordinator holds an ApplicationStateSynchronizer<TValue>, which reads the value the application
holds, and accepts each change through it:
using Forma.Framework.State.WebView;
var synchronizer = new ApplicationStateSynchronizer<ThemeChoice>(() => state.Choice);
// The callback runs one change at a time with its number, and every web view follows the value it returns.
var notification = synchronizer.Accept<Task>(number =>
{
var applied = integration.ApplyAsync(new AcceptedTheme(choice, new ThemeVersion(synchronizer.SequenceKey, number)));
return (applied, state.Choice);
});
SequenceKey identifies the sequence within which a change's number is meaningful. Each synchronizer creates its own,
so the culture's and the theme's are distinct in the same run of the application.
Each web view takes part through a WebViewStateFollower<TValue> of its own:
| Member | What it does |
|---|---|
Join() |
Called on the web view's UI thread, joins the synchronizer and returns the value the application holds, which the web view's document starts from |
StartFollowing() |
Has the document follow each value accepted after it joined, the latest of any accepted before this alone |
ApplyToThread(value) |
Overridden to apply a value on the web view's UI thread as the thread takes it, as the culture sets the thread's cultures |
FollowDocumentAsync(value, cancellationToken) |
Overridden to have the web view's document follow a value, answering whether it did |
Release() |
Leaves the synchronizer, as a web view's scope does when it's disposed |
A web view whose UI thread no longer takes work, or whose document can't follow a value or leaves a follow unanswered for
a minute, leaves the synchronizer on its own, logged at Debug under the follower's logger.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Microsoft.Extensions.Logging (>= 11.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on formaui-net.Framework.State.WebView:
| Package | Downloads |
|---|---|
|
formaui-net.Framework.Culture.Blazor.WebView
What the culture state needs from a Blazor Hybrid application: by default, one culture for the whole application, across every web view in every native window, or, declared independent, one for each web view. |
|
|
formaui-net.Framework.Themes.WebView
One theme choice for a whole application, across every web view in every native window: read from the application's store as it starts, kept there as it changes, and drawn from its first paint in every document a web view that implements IWebViewDocuments creates. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.27 | 51 | 12/3/2026 |
| 1.0.0-preview.26 | 62 | 12/3/2026 |
| 1.0.0-preview.25 | 67 | 12/2/2026 |
| 1.0.0-preview.24 | 72 | 12/1/2026 |
| 1.0.0-preview.23 | 97 | 11/30/2026 |
| 1.0.0-preview.22 | 96 | 11/30/2026 |
| 1.0.0-preview.21 | 92 | 11/29/2026 |
What this release changed is in Forma's changelog: https://github.com/FormaUI/Forma/blob/v1.0.0-preview.27/CHANGELOG.md