Welcome Guest Search | Active Topics | Sign In | Register

WebView - Cannot Remove Closed/Closing EventHandlers Options
JK
Posted: Friday, August 5, 2016 9:48:21 AM
Rank: Advanced Member
Groups: Member

Joined: 7/20/2015
Posts: 52
Using 16.1.54, WPF. I've assigned event handlers to the WebViews Closing and Closed events in order to detect unexpected closures.

In some cases I want to deliberately close WebView. So in my code, I remove the handlers and call the Close method, as follows:

this.WebControl.WebView.Closing -= this.OnWebViewClosing;
this.WebControl.WebView.Closed -= this.OnWebViewClosed;
this.WebControl.WebView.Close(true);

After calling Close, I still see both handlers getting executed.

Additionally, the Closed event fires multiple times (at least 4, sometimes as many as 9) per WebView.

I would expect that:
1. If I remove my handlers then they should not fire
2. Closed should fire once per WebView

Please advise. Thanks!
eo_support
Posted: Friday, August 5, 2016 5:35:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

This most likely is because you have attached the handler multiple times. Please direct all further communications to this thread:

http://www.essentialobjects.com/forum/postsm41303_WebView-API-Doc--Closing-Event.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.