Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
I'm curious about a related question using .NET technology: can the latest version of Microsoft's RichEdit control be embedded inside a Mathematica notebook? This would enable one to import verbatim snippets of mathematical text from Microsoft Office 2010 while retaining its original appearance and the ability to edit the imported text from within a Mathematica notebook. Such a feature would also facilitate sharing content between Office 2010 and CDF documents. –  StackExchanger May 6 '12 at 4:46
    
The word "editor" may be confusing. You may consider a FrontEnd window as an editor, though it's more than that. There's also the editor in Mathematica Workbench. That's more like the usual concept of an editor. –  Sjoerd C. de Vries May 6 '12 at 8:32
4  
If you mean the Front End, i.e. the GUI you see when you start Mathematica, I strongly suspect the answer is no. I think most of us wouldn't dare to say no categorically (we've been surprised too many times before), but I've never seen anything like this before on MathGroup or here. –  Szabolcs May 6 '12 at 12:35
    
Yes, I meant the front end. –  Dmitri Nesteruk May 6 '12 at 16:31
    
This seems like something you would need to license from Wolfram. You're asking for full fledged MMA functionality, but not in MMA.... –  tkott May 7 '12 at 2:10

2 Answers 2

up vote 8 down vote accepted

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 CDF notebook. 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 Export (or Import) from the CDF. This is where the "deployed" free CDF will 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 CDF could 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.

share|improve this answer
1  
This would be limited to CDF functionality and sandboxed. Being able to embed a full Mathematica notebook as a .NET window would be ideal. –  Chris Degnen May 6 '12 at 22:37
1  
@ChrisDegnen Yes, so this may or may not be enough. Beyond this, one may be better off trying to re-implement a sort of notebook interface in the external application and linking to the Kernel from that. They have such an interface for Mathematica in Sage. –  Jens May 7 '12 at 1:55
1  
I guess this will have to do for now. Thanks for the idea! –  Dmitri Nesteruk May 7 '12 at 18:50

The next best thing would be to use NET/Link to open Mathematica notebooks, see:

How to output from a .NET console app to an existing Notebook in Mathematica?

Of course, this would require that Mathematica is installed on the target system, but for debugging uses it would be simply perfect.

share|improve this answer
    
Here is a way to create a notebook window with content from .NET: stackoverflow.com/a/8039266/879601 –  Chris Degnen Feb 7 '13 at 8:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.