JavascriptObjectRepository seems can not effect UI thread? #3768
-
I followed the "How do you expose a .NET class to JavaScript" and achieved it, but when I change UI in class method, there will be some error in console when call it, like this:
JS code:
error:
so is there a way like webbrowser.ObjectForScripting can effect to the window UI ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Assuming boundObject was created on your UI thread, you need to invoke mainWindow.Title because the call into boundObject.add is made on the CEF UI thread. PS: The stacktrace tells you that because it failed on |
Beta Was this translation helpful? Give feedback.
Assuming boundObject was created on your UI thread, you need to invoke mainWindow.Title because the call into boundObject.add is made on the CEF UI thread.
PS: The stacktrace tells you that because it failed on
Dispatcher.VerifyAccess()
, which checks that you are calling from the same thread.