formaui-net.Framework.State.WebView 1.0.0-preview.27

Prefix Reserved
This is a prerelease version of formaui-net.Framework.State.WebView.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="formaui-net.Framework.State.WebView" Version="1.0.0-preview.27" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="formaui-net.Framework.State.WebView" Version="1.0.0-preview.27" />
                    
Directory.Packages.props
<PackageReference Include="formaui-net.Framework.State.WebView" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
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"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package formaui-net.Framework.State.WebView@1.0.0-preview.27
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=formaui-net.Framework.State.WebView&version=1.0.0-preview.27&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=formaui-net.Framework.State.WebView&version=1.0.0-preview.27&prerelease
                    
Install as a Cake Tool

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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