Exemplo n.º 1
0
        /// <summary>
        /// If your code already started your BlazorWebView.LaunchBlazorApp method, you should retrieve here the Electron main BrowserWindow used to create it.
        /// Otherwise, return a null Task value
        /// </summary>
        /// <returns></returns>
        public static Task <BrowserWindow> GetBrowserWindow()
        {
            var blazorWebView         = BlazorWebViewFactory.GetMainElectronBlazorWebViewInstance();
            var electronBlazorWebView = blazorWebView as ElectronBlazorWebView;

            if (electronBlazorWebView == null)
            {
                return(Task.FromResult((BrowserWindow)null));
            }

            return(electronBlazorWebView.GetBrowserWindow());
        }