diff --git a/ElectronNET.API/App.cs b/ElectronNET.API/App.cs index f48976d..f87344a 100644 --- a/ElectronNET.API/App.cs +++ b/ElectronNET.API/App.cs @@ -353,10 +353,28 @@ namespace ElectronNET.API private event Action _accessibilitySupportChanged; + /// + /// Emitted when the application has finished basic startup. + /// + public event Action Ready; + /// /// Application host fully started. /// - public bool IsReady { get; internal set; } + public bool IsReady + { + get { return _isReady; } + internal set + { + _isReady = value; + + if(value) + { + Ready?.Invoke(); + } + } + } + private bool _isReady = false; /// /// A property that indicates the current application's name, which is the diff --git a/ElectronNET.WebApp/Controllers/MenusController.cs b/ElectronNET.WebApp/Controllers/MenusController.cs index ebf6a9b..8add209 100644 --- a/ElectronNET.WebApp/Controllers/MenusController.cs +++ b/ElectronNET.WebApp/Controllers/MenusController.cs @@ -11,9 +11,13 @@ namespace ElectronNET.WebApp.Controllers { if (HybridSupport.IsElectronActive) { - if (Electron.App.IsReady) + if(Electron.App.IsReady) { CreateContextMenu(); + } + else + { + Electron.App.Ready += () => CreateContextMenu(); } var menu = new MenuItem[] {