**Help** Looking for suggestions on how to consume custom events from application #3903
Unanswered
syncmasterkk
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm currently using webview2 with Winforms and reference to dll which is a COM object. There are certain event handlers in the dll and i'm trying to consume.
When i create the event subscription in the WinForms app which uses webview2, i got invalidcastexception error when the event is triggered and a webview2 code is run something like executescriptasync is
So, i consumed the event, instead of running webview2 code at this thread, i used a flag(Boolean). So, when the flag value changed, i tried to executescriptasync, NO error but the script doesnt seem to run. I opened the dev tools console and manually run that script, i could see that expected behavior.
I'm looking for some suggestions on what could be done to run the script in webview2 after the event is triggered from the dll or after the flag is changed.
I did follow to use a timer logic , timer tick event for use like "btncontrol.Invoke() with MethodInvoker delegate but no avail.
I'm just looking for some suggestions, how to make webview2 run script after the events or value change.
I was able to run scripts in the webview2 for NavigationStarting event but not for the above mentioned scenario.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions