views:

21

answers:

0

Hello,

Let's say we have a JavaScript class:

function toy() {
    this.hello = function(msg) {
        alert('how are you? ' + msg);
    }
}

In Silverlight in-browser mode, we can use HtmlWindow.CreateInstance to create an instance of JavaScript class and get the ScriptObject, like below:

var toyScriptObject = htmlWindow.CreateInstance("toy");
toyScriptObject.Invoke("hello", "Buzz Lightyear");

But how to achieve that in Silverlight out-of-browser mode? I know in oob we have WebBrowser control, but the InvokeScript(String) method seems not able to return complicated ScriptObject back to C#...

Thanks for any kind of help!