How can I add a Content to panel plug-in

Situation : I’m trying to make a wpf panel plug-in by referencing sampleCSWpfPanel.(Sorry, I forgot where did I find that Code)

Problem : I cannot find a way to add a button(or any other object) to stackpanel of the panel.
(For example, When I click a button on another panel(or window), a button should be Added to the stackpanel)

Does anyone know how to solve this problem?

*Sorry for my poor English.

Basically, I don’t know how to get the Instance of panel, whose base is mainWindow.xaml. I want to find the Instance of mainWindow.xaml.

I had success with this method:

MyPanel panel = (MyPanel)Rhino.UI.Panels.GetPanel(MyPanel.PanelID); (RH5/Mac)

or

MyPanel panel = Rhino.UI.Panels.GetPanel<MyPanel>(); (RH6)

I’m using Eto, though…

1 Like

(Rhino.UI.Panels.GetPanel(MainPaenlHost.PanelId) as RhinoWindows.Controls.WpfElementHost).Child as MainPanel

Thx!!