[PR #941] Feat: Add Electron.NET startup lifecycle events #1376

Open
opened 2026-01-29 17:00:09 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/ElectronNET/Electron.NET/pull/941

State: closed
Merged: No


This PR introduces support for multiple startup/shutdown callbacks to improve initialization control.
Previously, we only had OnAppReady, which runs too late for some features like protocol registration.

Now this supports:

  • OnBeforeReady → runs before Electron's ready (useful for protocol setup)
  • OnReady → same as current OnAppReady
  • OnWillQuit → triggered when shutdown starts
  • OnQuit → after everything is fully stopped

Also added:

  • New UseElectron overload with options
  • Updated RuntimeControllerAspNetBase to call the new events
  • Existing API stays compatible

This is an initial implementation and can be adjusted later based on feedback. Let me know if you'd like to change event order, naming, or extend it further.

**Original Pull Request:** https://github.com/ElectronNET/Electron.NET/pull/941 **State:** closed **Merged:** No --- This PR introduces support for multiple startup/shutdown callbacks to improve initialization control. Previously, we only had `OnAppReady`, which runs too late for some features like protocol registration. Now this supports: * `OnBeforeReady` → runs before Electron's `ready` (useful for protocol setup) * `OnReady` → same as current `OnAppReady` * `OnWillQuit` → triggered when shutdown starts * `OnQuit` → after everything is fully stopped Also added: * New `UseElectron` overload with options * Updated `RuntimeControllerAspNetBase` to call the new events * Existing API stays compatible --- This is an **initial implementation** and can be adjusted later based on feedback. Let me know if you'd like to change event order, naming, or extend it further.
claunia added the pull-request label 2026-01-29 17:00:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1376