CefSharp For WPF响应页面点击事件
2021-04-23 09:57
标签:from val proc new cat oid 文件路径 pre binder bound在C#中定义,这样就会调用BoundObject类的OpenFile方法 CefSharp For WPF响应页面点击事件 标签:from val proc new cat oid 文件路径 pre binder 原文地址:http://www.cnblogs.com/Lulus/p/7998297.html初始化
public MainWindow()
{
InitializeComponent();
//在js里面注册对象bound,然后用该对象调用C#方法
webBrowser.RegisterAsyncJsObject("bound", new BoundObject(this), BindingOptions.DefaultBinder); //Use the default binder to serialize values into complex objects
}
BoundObject.cs
public class BoundObject
{
private Window mainWindow { get; set; }
public BoundObject(Window _mainWindow)
{
mainWindow = _mainWindow;
}
///
js调用
bound.openFile();
文章标题:CefSharp For WPF响应页面点击事件
文章链接:http://soscw.com/index.php/essay/78471.html