C# NanUI WinFormium监听页面加载开始\结束

2021-06-04 20:04

阅读:569

标签:form   star   开始   www.   win   exe   htm   send   pre   


个人博客 地址:https://www.wenhaofan.com/article/20190501213608

因为NanUI文档中仅介绍了Formium窗口的监听,但是没有WinFormium相关的文档,查看源码后才找到监听方法,特此记录一下

public partial class Form1 : WinFormium
{public Form1(): base("http://res.app.local/asserts/index.html")
{
	InitializeComponent();
        FileManager fm = new FileManager();
	LoadHandler.OnLoadStart += LoadHandler_OnLoadStart;
        LoadHandler.OnLoadEnd += LoadHandler_OnLoadEnd;
}

//监听页面加载完成
private void LoadHandler_OnLoadEnd(object sender, Chromium.Event.CfxOnLoadEndEventArgs e)
 {
     // Check if it is the main frame when page has loaded.
            
     //     ExecuteJavascript("sayHello()");
            
}
//监听页面加载结束
private void LoadHandler_OnLoadStart(object sender, Chromium.Event.CfxOnLoadStartEventArgs e)
{
    #if DEBUG
	Chromium.ShowDevTools();
    #endif
}
}

C# NanUI WinFormium监听页面加载开始\结束

标签:form   star   开始   www.   win   exe   htm   send   pre   

原文地址:https://www.cnblogs.com/fanwenhao/p/10841153.html


评论


亲,登录后才可以留言!