PhotinoX.Blazor 5.0.2

Prefix Reserved
There is a newer version of this package available.
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
                    
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="PhotinoX.Blazor" Version="5.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PhotinoX.Blazor" Version="5.0.2" />
                    
Directory.Packages.props
<PackageReference Include="PhotinoX.Blazor" />
                    
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 PhotinoX.Blazor --version 5.0.2
                    
#r "nuget: PhotinoX.Blazor, 5.0.2"
                    
#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 PhotinoX.Blazor@5.0.2
                    
#: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=PhotinoX.Blazor&version=5.0.2
                    
Install as a Cake Addin
#tool nuget:?package=PhotinoX.Blazor&version=5.0.2
                    
Install as a Cake Tool

PhotinoX Logo

PhotinoX.Blazor

NuGet Version Build License NuGet Downloads

Blazor integration for PhotinoX (native OS WebView host).

  • Windows: WebView2
  • macOS: WKWebView
  • Linux: WebKitGTK 4.1

Note: PhotinoX.Blazor is 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:

  • PhotinoBlazorApp owns the shared service provider and application lifecycle.
  • PhotinoBlazorWindow represents one native Photino window hosting Blazor content.
  • Each PhotinoBlazorWindow has 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" and window.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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed