Is it possible to embed a Mathematica window into a .NET application? I mean not just the interop, but actually making the notebook editor window part of a .NET form. Is this possible?
Here is an idea - it's by no means perfect, but then again, the comments indicate that there won't be a perfect solution:
- In your .NET application, create a web view (I don't know the details for this, but that would go beyond the scope of this forum anyway - I've done similar things in Cocoa on Mac, so you should be able to find analogous libraries for .NET)
- As the URL for the web view, give the address of an HTML page with an embedded Mathematica
CDFnotebook. This could mean simply using an
<embed>tag, as described on Wolfram's web site. Here I'm talking about a HTML file stored locally with your .NET bundle.
- Make sure you use the non-free version of a
CDF(the one you get via
Save As...). It should allow you to edit inside of it.
- Of course the next question is how to exchange data. That depends on what data you need. But basically, you can try to do it with
Import) from the
CDF. This is where the "deployed" free
CDFwill not work, but the non-free ones (requiring Mathematica to be installed) will, at least according to what I'm seeing on my machine. Then the .NET application would have to be notified when an exported file is ready to be passed to it. The
CDFcould accomplish that on its own, or you could have the .NET application monitor a certain data file (used by the
CDF) for changes.
Regarding the data exchange problem, see also this CDF related post.
The next best thing would be to use NET/Link to open Mathematica notebooks, see:
Of course, this would require that Mathematica is installed on the target system, but for debugging uses it would be simply perfect.