Hello, in Rhino 8 the plugin works fine on Windows, but on macOS, when the panel is closed and reopened, it becomes empty.
Is this something maybe related to macOS or etoforms?
using Rhino.PlugIns;using Rhino.UI;
namespace TestPlugin
{
public class TestPlugin: PlugIn
{
public static TestPlugin Instance { get; private set; }
public TestPlugin ()
{
Instance = this;
}
protected override LoadReturnCode OnLoad(ref string errorMessage)
{
Panels.RegisterPanel(this, typeof(TestPanel), "Test", Properties.Resources.test);
return LoadReturnCode.Success;
}
}
}
---------------------------------------------------------------
using Eto.Forms;
using System;
using System.Runtime.InteropServices;
namespace TestRhino
{
[Guid("EF3437E1-99A5-4408-A1F8-3721AA65525C")]
public class TestPanel: Panel
{
public static Guid PanelId => new Guid("EF3437E1-99A5-4408-A1F8-3721AA65525C");
private readonly PanelViewModel _viewModel;
public TestPanel()
{
var geometryMap = ViewModelData.GetGeometryMap();
var roofTypeMap = ViewModelData.GetRoofTypeMap();
var uiManager = new UIManager(geometryMap, roofTypeMap);
_viewModel = new PanelViewModel(uiManager, this);
Content = uiManager.CreateLayout();
_viewModel.HookEvents();
_viewModel.InitializeState();
}
protected override void Dispose(bool disposing)
{
if (disposing && Rhino.RhinoApp.IsClosing)
{
base.Dispose(disposing);
}
}
}
}
---------------------------------------------------------------
using Rhino;
using Rhino.Commands;
using Rhino.UI;
using System;
using System.Runtime.InteropServices;
namespace TestRhino
{
[Guid("15E43514-6B2A-447C-87B7-14A105D56A41")]
public class ShowTestPanelCommand : Command
{
public ShowTestPanelCommand ()
{
Instance = this;
}
public static ShowTestPanelCommand Instance { get; private set; }
public override string EnglishName => "TestPanel";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var panelId = TestPanel.PanelId;
var isVisible = Panels.IsPanelVisible(panelId);
if (isVisible)
{
// Hide the panel
Panels.ClosePanel(panelId);
}
else
{
// Show the panel
Panels.OpenPanel(panelId);
}
return Result.Success;
}
}
}