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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -