private void OnWebViewCreated(CreateWebViewCompletedEventArgs args) { int result = args.Result; WebView2WebView webView = args.WebView; if (webView != null) { _webView2WebView = webView; } RegisterHandlers(); // Resize WebView to fit the bounds of the parent window _webView2WebView.Bounds = new Rectangle(new Point(0, 0), Size); // Set any properties that we have cached because the browser wasn't created yet AreDevToolsEnabled = _initialAreDevToolsEnabled; ZoomFactor = _initialZoomFactor; OnBrowserCreated(EventArgs.Empty); if (!string.IsNullOrEmpty(_internalUrl)) { _webView2WebView.Navigate(_internalUrl); } }
/// <summary> /// Raises the /// </summary> /// <param name="e"></param> protected virtual void OnProcessFailed(ProcessFailedEventArgs e) { // Communication with the underlying webView2 is broken _webView2WebView = null; _handlersRegistered = false; if (ProcessFailed != null) { ProcessFailed(this, e); } }
internal CreateWebViewCompletedEventArgs(int result, ICoreWebView2Host webView) { Result = result; WebView = new WebView2WebView(webView); }
internal FocusChangedEventEventArgs(WebView2WebView webview, object args) { WebView2WebView = webview; Args = args; }