Skip to content

Added More Samples - #1133

Merged
FlorianRappl merged 3 commits into
developfrom
feature/more-samples
Nov 26, 2026
Merged

FlorianRappl merged 3 commits into
developfrom
feature/more-samples

Conversation

@FlorianRappl

Copy link
Copy Markdown
Collaborator

This pull request introduces new sample applications:

  • ElectronNET.Samples.AppIcons, demonstrating how to provide and configure application icons for Windows, Linux, and macOS in Electron.NET projects. It includes all necessary project files, runtime logic, packaging configurations, and documentation.
  • ElectronNET.Samples.BlazorServer, shows how a Blazor server application can be properly wired and used.
  • ElectronNET.Samples.PreloadScript, contains all parts to illustrate how preload scripts can be integrated and used to have custom communication between the web view and the bridge established.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

pr-comment: Run #175

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
1584 1444 0 0 0 140 0 2m 42s

🎉 All tests passed!

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved macOS window-recreation defects leave windows hidden, controls detached, and clocks stopped, while incorrect Electron version reporting and missing accessible input labels also need correction.

6 open issues
What changed in this PR

Adds three sample projects to the Electron.NET solution, demonstrating cross-platform application icons, Blazor Server integration, and communication through preload scripts.

Changes:

  • Adds runtime icon configuration, packaging settings, and platform-specific publishing profiles.
  • Demonstrates Blazor components using Electron window controls, native services, and desktop events.
  • Demonstrates an isolated preload API for request/reply messaging and .NET-to-page updates.
File Description
src/​ElectronNET.sln Registers all three sample projects.
src/​ElectronNET.Samples.PreloadScript/​wwwroot/​index.html Adds the messaging demonstration UI.
src/​ElectronNET.Samples.PreloadScript/​wwwroot/​app.js Connects page interactions to the preload API.
src/​ElectronNET.Samples.PreloadScript/​wwwroot/​app.css Styles the preload sample.
src/​ElectronNET.Samples.PreloadScript/​README.md Explains preload configuration and messaging.
src/​ElectronNET.Samples.PreloadScript/​Properties/​launchSettings.json Configures development startup.
src/​ElectronNET.Samples.PreloadScript/​Properties/​electron-builder.json Defines Linux and Windows packaging.
src/​ElectronNET.Samples.PreloadScript/​Program.cs Configures the window, message handlers, and clock.
src/​ElectronNET.Samples.PreloadScript/​Preload/​preload.js Exposes a restricted messaging API.
src/​ElectronNET.Samples.PreloadScript/​ElectronNET.Samples.PreloadScript.csproj Configures dependencies and preload deployment.
src/​ElectronNET.Samples.BlazorServer/​wwwroot/​js/​interop.js Provides viewport information through JavaScript interop.
src/​ElectronNET.Samples.BlazorServer/​wwwroot/​app.css Styles the Blazor sample.
src/​ElectronNET.Samples.BlazorServer/​README.md Documents architecture and integration patterns.
src/​ElectronNET.Samples.BlazorServer/​Properties/​launchSettings.json Configures development startup.
src/​ElectronNET.Samples.BlazorServer/​Properties/​electron-builder.json Defines Linux and Windows packaging.
src/​ElectronNET.Samples.BlazorServer/​Program.cs Wires Blazor, desktop services, and Electron startup.
src/​ElectronNET.Samples.BlazorServer/​ElectronNET.Samples.BlazorServer.csproj Configures dependencies and single-instance behavior.
src/​ElectronNET.Samples.BlazorServer/​Desktop/​WindowService.cs Wraps window controls and tracks window state.
src/​ElectronNET.Samples.BlazorServer/​Desktop/​NativeService.cs Wraps dialogs, notifications, clipboard, and shell APIs.
src/​ElectronNET.Samples.BlazorServer/​Desktop/​ElectronStartup.cs Creates the main window and application menu.
src/​ElectronNET.Samples.BlazorServer/​Desktop/​AppEvents.cs Relays desktop events to components.
src/​ElectronNET.Samples.BlazorServer/​Components/​Routes.razor Defines routing and navigation focus.
src/​ElectronNET.Samples.BlazorServer/​Components/​Pages/​WindowControl.razor Demonstrates window controls and live state.
src/​ElectronNET.Samples.BlazorServer/​Components/​Pages/​NotFound.razor Adds a missing-page view.
src/​ElectronNET.Samples.BlazorServer/​Components/​Pages/​Native.razor Demonstrates native desktop capabilities.
src/​ElectronNET.Samples.BlazorServer/​Components/​Pages/​Interactivity.razor Demonstrates binding and JavaScript interop.
src/​ElectronNET.Samples.BlazorServer/​Components/​Pages/​Home.razor Introduces the sample and its architecture.
src/​ElectronNET.Samples.BlazorServer/​Components/​Pages/​Error.razor Adds a noninteractive error page.
src/​ElectronNET.Samples.BlazorServer/​Components/​Layout/​MainLayout.razor Adds navigation and desktop-menu event handling.
src/​ElectronNET.Samples.BlazorServer/​Components/​App.razor Defines the document and render-mode selection.
src/​ElectronNET.Samples.BlazorServer/​Components/​_Imports.razor Shares component namespace imports.
src/​ElectronNET.Samples.BlazorServer/​appsettings.json Sets logging and allowed-host defaults.
src/​ElectronNET.Samples.BlazorServer/​appsettings.Development.json Configures development logging.
src/​ElectronNET.Samples.AppIcons/​wwwroot/​index.html Explains platform-specific icon usage.
src/​ElectronNET.Samples.AppIcons/​README.md Documents icon formats, creation, and packaging.
src/​ElectronNET.Samples.AppIcons/​Properties/​PublishProfiles/​win-x64.pubxml Adds self-contained Windows x64 publishing.
src/​ElectronNET.Samples.AppIcons/​Properties/​PublishProfiles/​osx-x64.pubxml Adds self-contained macOS x64 publishing.
src/​ElectronNET.Samples.AppIcons/​Properties/​PublishProfiles/​osx-arm64.pubxml Adds self-contained macOS ARM64 publishing.
src/​ElectronNET.Samples.AppIcons/​Properties/​PublishProfiles/​linux-x64.pubxml Adds self-contained Linux x64 publishing.
src/​ElectronNET.Samples.AppIcons/​Properties/​launchSettings.json Configures development startup.
src/​ElectronNET.Samples.AppIcons/​Properties/​electron-builder.json Configures package targets and platform icons.
src/​ElectronNET.Samples.AppIcons/​Program.cs Applies runtime window and Dock icons.
src/​ElectronNET.Samples.AppIcons/​ElectronNET.Samples.AppIcons.csproj Configures dependencies and icon deployment.
src/​ElectronNET.Samples.AppIcons/​Assets/​app.svg Adds source artwork for the sample icon.
Changelog.md Records support for WebContentsView.

Review effort: Balanced

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@FlorianRappl
FlorianRappl merged commit ee7bb60 into develop Nov 26, 2026
15 checks passed
@FlorianRappl
FlorianRappl deleted the feature/more-samples branch November 27, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants