但是在构建时-调用线程必须是STA,因为许多UI组件在第一个浏览器中都需要这样做.MouseMove(x,y)
public MainWindow()
{
// Initialize WPF Application UI.
InitializeComponent();
// Create WPF BrowserView component.
browser = BrowserFactory.Create();
browserView = new WPFBrowserView(browser);
// Embed BrowserView component into main layout.
mainLayout.Children.Add(browserView);
browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e)
{
if (e.IsMainFrame)
{
int x = 100;
int y = 10;
browser.MouseMove(x, y);
}
};
browserView.Browser.LoadURL("http://google.com");
}
答案 0 :(得分:0)
尝试将代码包装在Dispatcher.BeginInvoke中。
custom:
webpack:
includeModules: true