PhotinoX.Blazor
5.0.2
Prefix Reserved
See the version list below for details.
dotnet add package PhotinoX.Blazor --version 5.0.2
NuGet\Install-Package PhotinoX.Blazor -Version 5.0.2
<PackageReference Include="PhotinoX.Blazor" Version="5.0.2" />
<PackageVersion Include="PhotinoX.Blazor" Version="5.0.2" />
<PackageReference Include="PhotinoX.Blazor" />
paket add PhotinoX.Blazor --version 5.0.2
#r "nuget: PhotinoX.Blazor, 5.0.2"
#:package PhotinoX.Blazor@5.0.2
#addin nuget:?package=PhotinoX.Blazor&version=5.0.2
#tool nuget:?package=PhotinoX.Blazor&version=5.0.2
PhotinoX.Blazor
Blazor integration for PhotinoX (native OS WebView host).
- Windows: WebView2
- macOS: WKWebView
- Linux: WebKitGTK 4.1
Note:
PhotinoX.Blazoris an independent fork of tryphotino/photino.Blazor under the Apache‑2.0 license and is not affiliated with the original project or organization.
Quick start
[STAThread]
static void Main(string[] args)
{
var appBuilder = PhotinoBlazorAppBuilder.CreateDefault(args);
appBuilder.Services
.AddLogging();
// Register the root component and selector for the main window.
appBuilder.RootComponents.Add<App>("app");
var app = appBuilder.Build();
// Customize the native Photino window.
app.MainBlazorWindow.Window
.SetIconFile("favicon.ico")
.SetTitle("PhotinoX Blazor Sample");
AppDomain.CurrentDomain.UnhandledException += (_, error) =>
{
app.MainBlazorWindow.Window.ShowMessage(
"Fatal exception",
error.ExceptionObject?.ToString() ?? "Unknown fatal exception.");
};
app.Run();
}
Application and window model
PhotinoX.Blazor separates application-level services from window-level Blazor hosting:
PhotinoBlazorAppowns the shared service provider and application lifecycle.PhotinoBlazorWindowrepresents one native Photino window hosting Blazor content.- Each
PhotinoBlazorWindowhas its own root components, WebView manager, Blazor dispatcher/synchronization context, and message pipeline.
Window-scoped services are isolated through a per-window service provider, so HttpClient, resource handling, root components, and WebView manager state are scoped to each window.
This makes multi-window scenarios explicit and avoids sharing window-specific Blazor state between native windows.
Root components should be configured before the corresponding PhotinoBlazorWindow.Show() call.
Application scheme
PhotinoX.Blazor uses the app custom scheme on Windows, macOS, and Linux. The upstream Windows http workaround is no longer used because PhotinoX.Native now supports custom scheme navigation on WebView2.
URL loading
PhotinoX.Blazor supports BlazorWebView-style URL loading policy through PhotinoBlazorWindow.UrlLoading.
Normal top-level navigation raises UrlLoading, allowing the app to choose whether a URL should load inside the WebView, open externally, or be canceled.
app.MainBlazorWindow.UrlLoading += (_, e) =>
{
if (e.Url.Scheme is "http" or "https")
e.UrlLoadingStrategy = UrlLoadingStrategy.OpenExternally;
};
Default behavior:
- app-origin URLs load inside the WebView;
- external HTTP/HTTPS URLs open in the system browser;
target="_blank"andwindow.open(...)are handled as new-window requests and open externally.
Key differences from Photino.Blazor
| Area | Photino.Blazor | PhotinoX.Blazor |
|---|---|---|
| Application model | Main-window host built around PhotinoWindow.WaitForClose(). |
Runs on top of the PhotinoApplication model. |
| Window hosting | Main window, root components, WebView manager, and services are mostly application-level. | Each PhotinoBlazorWindow has window-scoped root components, resource handling, WebView manager state, and Blazor dispatcher/synchronization context. |
| Application scheme | Uses http on Windows and app on Linux/macOS. |
Uses app on all supported platforms. |
| URL loading policy | No BlazorWebView-style UrlLoading API for intercepting normal link navigation. |
Adds UrlLoading, UrlLoadingEventArgs, and UrlLoadingStrategy for intercepting top-level navigation and choosing OpenInWebView, OpenExternally, or CancelLoad. |
Multiple windows
[STAThread]
static void Main(string[] args)
{
var appBuilder = PhotinoBlazorAppBuilder.CreateDefault(args);
appBuilder.Services
.AddLogging();
appBuilder.RootComponents.Add<Window1>("app");
var app = appBuilder.Build();
var window1 = app.MainBlazorWindow;
window1.Window
.SetTitle("Window 1")
.Load("window1.html");
var window2 = app.CreateWindow<Window2>("app");
window2.Window
.SetTitle("Window 2")
.Load("window2.html");
window1.Window.RegisterCreatedHandler((_, _) =>
{
window2.Show();
});
app.Run();
}
Core (ecosystem)
- PhotinoX - managed .NET wrapper around the native layer.
- PhotinoX.App - Application composition layer for PhotinoX desktop applications.
- PhotinoX.Native - native binaries for Windows/macOS/Linux.
- PhotinoX.Server - optional local static-file server for SPA/static assets.
- PhotinoX.Samples - sample projects showcasing common scenarios.
Install
dotnet add package PhotinoX.Blazor
PhotinoX.Native provides the native WebView host binaries and must be available for the target runtime identifier.
Package targets net8.0; net9.0; net10.0.
Samples
Requirements
- .NET 10 SDK (build)
- Target frameworks:
net8.0; net9.0; net10.0(package supports all three) - Runtime deps: see PhotinoX.Native (
runtimes/<rid>/native/) - Windows: Microsoft Edge WebView2 Runtime
https://learn.microsoft.com/microsoft-edge/webview2/ - macOS: WKWebView (system WebKit)
https://developer.apple.com/documentation/webkit/wkwebview/ - Linux: WebKitGTK 4.1 (runtime + dev packages)
https://webkitgtk.org/
Build from source
dotnet restore Photino.Blazor/PhotinoX.Blazor.csproj
dotnet build Photino.Blazor/PhotinoX.Blazor.csproj -c Release
dotnet pack Photino.Blazor/PhotinoX.Blazor.csproj -c Release -o artifacts
CI: see
.github/workflows/build.yml(build + pack + upload.nupkg/.snupkg).
Contributing
Issues and PRs are welcome. Keep PRs focused, minimal, and consistent with the rest of PhotinoX.
License
PhotinoX.Blazor is licensed under Apache‑2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.WebView (>= 10.0.11)
- Microsoft.Extensions.Logging.Console (>= 10.0.11)
- PhotinoX (>= 5.0.2)
-
net8.0
- Microsoft.AspNetCore.Components.WebView (>= 8.0.30)
- Microsoft.Extensions.Logging.Console (>= 10.0.11)
- PhotinoX (>= 5.0.2)
-
net9.0
- Microsoft.AspNetCore.Components.WebView (>= 9.0.19)
- Microsoft.Extensions.Logging.Console (>= 10.0.11)
- PhotinoX (>= 5.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PhotinoX.Blazor:
| Package | Downloads |
|---|---|
|
BlazorHMR.PhotinoX
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.5.0 | 519 | 11/11/2026 |
| 5.4.1 | 471 | 11/4/2026 |
| 5.4.0 | 120 | 11/3/2026 |
| 5.3.5 | 1,727 | 10/6/2026 |
| 5.3.4 | 220 | 10/5/2026 |
| 5.3.3 | 660 | 10/1/2026 |
| 5.3.2 | 314 | 9/30/2026 |
| 5.3.1 | 508 | 9/27/2026 |
| 5.3.0 | 187 | 9/26/2026 |
| 5.2.3 | 424 | 9/24/2026 |
| 5.2.2 | 378 | 9/19/2026 |
| 5.2.1 | 213 | 9/18/2026 |
| 5.2.0 | 203 | 9/16/2026 |
| 5.1.2 | 989 | 8/25/2026 |
| 5.1.1 | 245 | 8/23/2026 |
| 5.1.0 | 185 | 8/21/2026 |
| 5.0.3 | 426 | 8/17/2026 |
| 5.0.2 | 257 | 8/17/2026 |
| 5.0.1 | 188 | 8/15/2026 |
| 5.0.0 | 308 | 8/12/2026 |
