Embedding Electron as Panes in a WinForms or WPF Window or Equivalent X-Platform Window? #267

Closed
opened 2026-01-29 16:35:14 +00:00 by claunia · 2 comments
Owner

Originally created by @pha3z on GitHub (Feb 4, 2019).

Originally assigned to: @GregorBiswanger on GitHub.

My current project has this bill of needs:

  • Support mac OS, Linux, and Windows
  • Must allow embedding a UI Control that targets WinForms, WPF, and Xamarin
  • Prefer C# as the primary language

Electron would be perfect for our project, except for the problem that you can't embed a native UI control in electron. Someone suggested the following solution:

Host our main app in a native window on each device.
Split the window into panes (like a sidebar, header bar, and main pane).
Host a web UI (such as Electron) in the sidebar pane and another web UI in the header pane
Host the native UI control in the main pane.

So basically we'd have two instances of a web UI (Electron) and one instance of a native UI element -- each one in its own pane. And they all three communicate with a backend that drives it all.

Only the master container window would need to vary per platform so that the native OS can host it.

To me, this seems like the holy grail of cross-platform support -- being able to display HTML/CSS/JS UI controls in the same window as native controls by "containerizing" everything in separate panes. Can this be done with either Electron or Electron.NET?

Originally created by @pha3z on GitHub (Feb 4, 2019). Originally assigned to: @GregorBiswanger on GitHub. My current project has this bill of needs: - Support mac OS, Linux, and Windows - Must allow embedding a UI Control that targets WinForms, WPF, and Xamarin - Prefer C# as the primary language Electron would be perfect for our project, except for the problem that you can't embed a native UI control in electron. Someone suggested the following solution: Host our main app in a native window on each device. Split the window into panes (like a sidebar, header bar, and main pane). Host a web UI (such as Electron) in the sidebar pane and another web UI in the header pane Host the native UI control in the main pane. So basically we'd have two instances of a web UI (Electron) and one instance of a native UI element -- each one in its own pane. And they all three communicate with a backend that drives it all. Only the master container window would need to vary per platform so that the native OS can host it. To me, this seems like the holy grail of cross-platform support -- being able to display HTML/CSS/JS UI controls in the same window as native controls by "containerizing" everything in separate panes. Can this be done with either Electron or Electron.NET?
claunia added the question label 2026-01-29 16:35:14 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (May 16, 2019):

WPF and WinForms only run on Windows. Electron can not render these in Chromium.

@GregorBiswanger commented on GitHub (May 16, 2019): WPF and WinForms only run on Windows. Electron can not render these in Chromium.
Author
Owner

@meteorsnows commented on GitHub (May 19, 2019):

Actually it might be a bit tricky and hacky, I am thinking there is these way, but no enough expertise to bridge and minimize the disruption and bring as harmony and integrate properly as possible.
https://stackoverflow.com/questions/301678/embedding-a-winform-within-a-winform-c
https://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-project

@meteorsnows commented on GitHub (May 19, 2019): Actually it might be a bit tricky and hacky, I am thinking there is these way, but no enough expertise to bridge and minimize the disruption and bring as harmony and integrate properly as possible. https://stackoverflow.com/questions/301678/embedding-a-winform-within-a-winform-c https://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-project
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#267