Created
May 29, 2012 09:56
-
-
Save DinisCruz/2823628 to your computer and use it in GitHub Desktop.
Chrome WPF control with zoom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //var webView = new WebView("http://www.whatismybrowser.com", new BrowserSettings()); | |
| var topPanel = panel.clear().add_Panel(); | |
| var autoResetEvent = new AutoResetEvent(false); | |
| var webView = (WebView)topPanel.invokeOnThread( | |
| ()=>{ | |
| //var _webView = new WebView("http://about:blank", new BrowserSettings()); | |
| var elementHost = topPanel.add_WPF_Host(); | |
| var zoom = elementHost.add_Zoom(); | |
| var _webView = zoom.set<WebView>(); | |
| _webView.width_Wpf(500) | |
| .height_Wpf(300); | |
| //var _webView = topPanel.add_WPF_Control<WebView>(); | |
| _webView.PropertyChanged+= | |
| (browserCore, eventArgs)=>{ | |
| if (eventArgs.PropertyName == "IsBrowserInitialized") | |
| autoResetEvent.Set(); | |
| O2Thread.mtaThread(()=> eventArgs.PropertyName.info()); | |
| }; | |
| return _webView; | |
| }); | |
| autoResetEvent.WaitOne(2000); | |
| //return webView is System.Windows.Forms.Integration.ElementHost;//.add_Zoom(); | |
| webView.Load("http://www.whatismybrowser.com"); | |
| //O2File:GraphLayout_WPF_ExtensionMethods.cs | |
| //O2Ref:GraphSharp.dll | |
| //O2Ref:GraphSharp.Controls.dll | |
| //O2Ref:QuickGraph.dll | |
| //O2Ref:WPFExtensions.dll | |
| return "ok"; | |
| //return webView; | |
| //using System.Threading; | |
| //O2File:WPF_ExtensionMethods.cs | |
| //using CefSharp | |
| //using CefSharp.Wpf | |
| //O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.Wpf.dll | |
| //O2Ref:CefSharp\CefSharp-0.11-bin\CefSharp.dll | |
| //O2Ref:WindowsFormsIntegration.dll | |
| //O2Ref:PresentationFramework.dll | |
| //O2Ref:PresentationCore.dll | |
| //O2Ref:WindowsBase.dll | |
| //O2Ref:System.Xaml.dll |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment