private void _webView2Control_NewWindowRequested(object sender, NewWindowRequestedEventArgs e)
        {
            IWebView2Deferral deferral  = e.GetDeferral();
            MainForm          newWindow = new MainForm(e, deferral);

            newWindow.Show();
        }
        public PopupWindow(WebView2Environment environment, NewWindowRequestedEventArgs args)
            : this()
        {
            // Save the environment so we can create the webview
            _environment = environment;
            _args        = args;

            // Get a deferral since we have to wait for the window creation to finish
            _deferral = _args.GetDeferral();
        }