public MainWindow() { InitializeComponent(); DirectoryService.Set(AppDomain.CurrentDomain.BaseDirectory); var webView = new WPFBrowserView(); webView.FinishLoadingFrameEvent += BrowserView_OnFinishLoadingFrameEvent; BrowserGrid.Children.Add((UIElement)webView.GetComponent()); webView.Browser.LoadURL("https://en.bitefight.gameforge.com/game"); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { mainLayout.Children.Add((UIElement)browserView.GetComponent()); ManualResetEvent waitEvent = new ManualResetEvent(false); browser.FinishLoadingFrameEvent += delegate(object sender1, FinishLoadingEventArgs e1) { // Wait until main document of the web page is loaded completely. if (e1.IsMainFrame) { waitEvent.Set(); } }; browser.LoadURL("teamdev.com"); waitEvent.WaitOne(); label1.Content = "Press button 'XPath' to view an info about <div> on this page"; label2.Content = ""; label3.Content = ""; label4.Content = ""; label5.Content = ""; button1.Content = "XPath"; }