Using Eto in Rhino 5 for Windows

So I have a client who needs a plugin I have written in C# for Rhino 6 to run under Rhino 5. I use ETO for the UI - it’s a single dockable panel – is there any chance of getting this to run on Rhino 5 using ETO, or is that a lost cause?

Hey @ian4,

Yes you can do it, but for Rhino 5 on Windows you will have to include Eto.dll and Eto.Wpf.dll. On Rhino 5 for Mac this gets complicated because it includes an ancient version of Eto (v2.3), so you’ll have to target that version when compiling, or limit yourself to only API’s that are available in that version.

To initialize Eto, you can simply do the following:

if (Application.Instance == null)
  new Application(Platforms.Wpf).Attach();

// now you can create eto stuff
var dialog = new Dialog { Content = "Hello!" };

A big caveat to doing this is that all of the things we added to better integrate Eto with Rhino such as creating Eto-based panels, or properly parenting dialogs or forms via RhinoEtoApp.MainWindow will not be available.

Hope this helps!

Hmmm – so no dockable dialogs?

For Windows, you could theoretically use Eto’s WinForms platform and use the myEtoControl.ToNative() extension to return a WinForms panel control, which I believe Rhino 5 on Windows supports.

I can’t really remember what Rhino 5 on Mac had wired up for panels, but it may be doable in the same manner (but with Eto’s Mac64 platform).

This is all theoretical though, I have not tried any of the above.