Page finished loading event?

Nov 19, 2010 at 5:10 AM

I'm trying to receive an event indicating the page has successfully loaded using this code:

OnFinishLoadingHandler feh = new OnFinishLoadingHandler(onFinishLoading);
view.OnFinishLoading += feh;

private void onFinishLoading()
{
}

But the event is never triggered. I have also tried several other approaches, like

view.OnFinishLoading += onFinishLoading;

But still, no event is ever triggered..

What is the correct syntax for this?

Coordinator
Nov 19, 2010 at 7:43 AM
Edited Nov 19, 2010 at 7:44 AM

The handler should look like this:

private void OnFinishLoading(object sender, FinishLoadingEventArgs e)
{
}

 

And setting it up:

webView.FinishLoading += OnFinishLoading;
// or
webView.FinishLoading += new EventHandler<FinishLoadingEventArgs>(OnFinishLoading);

 

 

This sample shows how to do it: https://awesomiumdotnet.svn.codeplex.com/svn/trunk/samples/Basic/Basic.cs

Nov 21, 2010 at 3:54 PM

Hm, thank you, but it does not compile, there is no

webView.FinishLoading 

field here.

But I have
webView.OnFinishLoading 

Perhaps I am using the wrong version of the library?

Also, no
FinishLoadingEventArgs 

class is found...
Coordinator
Nov 21, 2010 at 6:16 PM

Yes, you're using an old version where FInishedLoading was called OnFinishedLoading and FinishedLoadingEventArgs is in the Awesomium.Args namespace.

I recommend you to download a stable release like AwesomiumDotNet 1.2.1 and use it with Awesomium 1.5.1.

Nov 22, 2010 at 4:09 AM

Thank you again for your help. I have now downloaded awesomium-v1.5.1-sdk-msvc9.exe (I did not run it, just extracted the files) and AwesomiumDotNet-1.2.1.zip

I then copied Awesomium.dll (9388 kb) and AwesomiumDotNet.dll (157kb) found there over my old ones. But, now I get a compiler error:

Warning    5    Could not resolve this reference. Could not locate the assembly "AwesomiumDotNet, Version=1.0.8.0, Culture=neutral, processorArchitecture=x86". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Any idea how to fix it? I'm on Windows 7, 64 bit.

(Copying back the old dll's Awesomium.dll (8568kb) and AwesomiumDotNet.dll (108kb) makes the old version work again.)

Coordinator
Nov 22, 2010 at 4:39 AM

You need to remove the previous reference from your project and add a reference to the new AwesomiumDotNet.dll.

Nov 22, 2010 at 7:50 AM

I got it to compile and run, but it still did not trigger the event. Finally I figured out the event will only be triggered when webCore.Update() is called, and before I did not call this one. Now it works. :)