I’m working on a project in which we have to call some JS method of the containing page from a Silverlight application.
It seems to be really straight forward like:
But this works only for global methods and not for JS class methods.
In fact this will not work:
You can make a global wrapper for every class methods but you can also do something like this:
private ScriptObject _jsObject = HtmlPage.Window.Eval("JsClassInstance") as ScriptObject;
that is far more elegant.
This is only a quick tip. Maybe I’ll write a more detailed post an JS-Silverlight interaction in the future.