public BrowserWindow(WebBrowser webBrowser) { _webBrowser = webBrowser; _zoomFactor = GetZoomFactor(); _uiHandler = new WebBrowserHostUIHandler(_webBrowser) { IsWebBrowserContextMenuEnabled = false }; }
private void InitBrowser() { Control = new WebBrowser { HorizontalAlignment = HorizontalAlignment.Stretch }; _uiHandler = new WebBrowserHostUIHandler(Control) { IsWebBrowserContextMenuEnabled = false }; Control.LoadCompleted += (s, e) => { Zoom(_zoomFactor); _htmlDocument = (HTMLDocument)Control.Document; _documentRenderer.RenderCodeBlocks(_htmlDocument); }; // Open external links in default browser Control.Navigating += OnNavigating; }