Eto Form Preview in VS

220 views
Skip to first unread message

fairw...@gmail.com

unread,
Nov 24, 2015, 4:17:36 PM11/24/15
to Eto.Forms
Hi,

I'm using the ETO Plugin in Visual Studio 2015 and have been having some issues with the form preview.  I cannot seem to get the form preview compiler to recognize references to namespaces within my project and references to other projects in my solution.  I have tried modifying your code to capture the active references and pass them to the compiler (DTE2, etc) but I am not the most skilled with this.  It appears as though the only references for the form preview compiler are hard coded in CodeInterfaceBuilder.SetParameters.  Am I reading this correctly and do you have any suggestions for my dilemma?

Thanks!
Dan

curtis

unread,
Nov 24, 2015, 4:33:15 PM11/24/15
to Eto.Forms
Hi Dan,

This is a current limitation of the designer.  This is why the addin creates a partial class with two files (MyFile.eto.cs and MyFile.cs).  The *.eto.cs (designer) can only contain generic Eto.Forms UI, whereas anything you need from your project should go into MyFile.cs.   This does make it difficult to use custom controls in your UI, but you can create a Panel as a placeholder then set its Content to your custom control in the MyFile.cs partial after the panel is initialized.

I haven't been able to figure out how to add references to your project from VS 2015.  Ideally, it'd be great to hook into the vshost.exe that is usually created for your project, but again I have no idea how to do that and couldn't find anything online. Perhaps this could be done by referencing the files from the output directory, though if you have copylocal=false on any other references that might still make things break.

Another issue that I need to figure out is to use a separate AppDomain to do the compile/load of the preview when using code-based preview (xaml/json doesn't currently have this issue).  Each compile currently adds memory overhead to VS, which is not too bad right now, but adding your project references will make that bloat very fast.  I have the designer working using an AppDomain in standalone mode, but it just doesn't seem to work when hosted in VS..

Any help on these would be certainly appreciated!  The VS addin infrastructure is not really all that straightforward and it feels like I'm flailing about when I have to try 10-15 different ways before getting something to actually work.

Cheers!
Curtis.

fairw...@gmail.com

unread,
Nov 24, 2015, 4:51:08 PM11/24/15
to Eto.Forms
Curtis,

Thank you for your quick reply!

As I said previously, I have been working with this issue and may eventually come up with something.  My current implementation includes a kludge to extract references to other projects in the solution, but not the current project.  One of my goals for this effort (beyond custom controls) is to have form preview when deriving from form base classes  with common design elements/layouts.  I will continue working with the functionality and let you know if I get anywhere with it.

Thanks again,
Dan
Reply all
Reply to author
Forward
0 new messages