c# - Calling function in WPF from silverlight inside web browser control -


i have wpf application web browser control inside silveriight application. earlier, have been able call functions wpf application sliverlight application using html bridge.

now, have opposite i.e. have call function inside wpf application silverlight.
how can done?

you can using property shown below:

c# part :

webbrowsercontrolname.objectforscripting = new scriptinterface(); 

where scriptinterface follows

[system.runtime.interopservices.comvisibleattribute(true)] public class scriptinterface {      public void csharpmethod(string data)     {         messagebox.show(data);     } } 

html part

in page load in web browser control following :

window.external.csharpmethod('from html page wpf'); 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -