Question

I am trying to open HTML file from the local URI which I use as XML Editor, to edit xml data that come from Silverlight application, then close browser window and return back edited xml data to the Silverlight application.

I tried to use HtmlPage.Window.Navigate but I don't quit like it.

I have tried using a method from: http://weblogs.asp.net/dwahlin/archive/2010/05/10/integrating-html-into-silverlight-applications.aspx

but instanly got an exception "failed to invoke ShowJobPlanIFrame"

Is there any way to handle this task? "Out of browser" mode doesn't fit.

Thanks.

===========================================================================

Update:

It worked out using IFrame overlay.

Button click invokes the following code in C#:

var scriptObject = (ScriptObject)HtmlPage.Window.GetProperty("ShowJobPlanIFrame");
scriptObject.InvokeSelf(url);

Where "ShowJobPlanIFrame" is as defined at: http://weblogs.asp.net/dwahlin/archive/2010/05/10/integrating-html-into-silverlight-applications.aspx

This allowed me to pass data into XML editor and then get it back.

An error with JavaScript function invocation I told above, was my fault in JavaScript code itself.

Was it helpful?

Solution 2

It worked out using IFrame overlay.

Button click invokes the following code in C#:

var scriptObject = (ScriptObject)HtmlPage.Window.GetProperty("ShowJobPlanIFrame");
scriptObject.InvokeSelf(url);

Where "ShowJobPlanIFrame" is as defined at:

http://weblogs.asp.net/dwahlin/archive/2010/05/10/integrating-html-into-silverlight-applications.aspx

This allowed me to pass data into XML editor and then get it back. An error with JavaScript function invocation I told above, was my fault in JavaScript code itself.

OTHER TIPS

A very similar scenario: https://stackoverflow.com/a/7919065/384316

Try using an iframe overlay, then you can load any HTML-like content.

There is an excellent explanation of how to do this here: http://www.wintellect.com/cs/blogs/jlikness/archive/2010/09/19/hosting-html-in-silverlight-not-out-of-browser.aspx

Did you try NavigationFramework of Silverlight? It's capability may support your needs in a more simple way than using multiple browser pages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top