Call javascript function from WPF browser application (xbap)

234 Views Asked by At

I am loading my xbap app into iFrame in a .aspx page. On button click in xbap application I want to call a JavaScript function which is in a page where xbap is loaded.

1

There are 1 best solutions below

0
monofal On BEST ANSWER

I have found the answer, you have to do something like this in your xbap when you call your javascript function

dynamic script = BrowserInteropHelper.HostScript;
script.document.javaScriptFunction();

and your javascript function looks like this

document.javaScriptFunction = function (){ your code here }

This method is working for all version of IE.