I’m using the RhinoWindows.dll in order to create and setup some custom DockBars in Rhino WIP, but I’m not able to find any documentation, summaries, or examples, so I have some questions:
1.- Im not able to add a WPF control, its always blank when I add it through base.SetContentFrameworkElement(ctrl) method
Although If I use Windows Forms and using method: base.SetContentControl(ctrl) it’s working perfectly. Question: Is there something that I am doing wrong in the code above?
2.- To move the DockBars programatically I found 2 methods:
Note though that for Rhino WIP we’re using Eto.Forms for commands and plug-ins that have a GUI. The obvious target is to have commands with their GUI eventually run on both Rhino for Windows and Rhino for Mac.
It would be best if developers started using Eto.Forms as well.
The dock location is in the coordinate system of the docking container. What exactly are you trying to do with the dock bar? It is the Rhino DockBar is essentially a MFC CControllBar.
Typically I would recommend creating a dock bar in your plug-in’s OnLoad override and I would suggest setting its visibility state to false then I would create a plug-in command to display/hide/toggle it. I suggest this because the Rhino frame work will save the visibility state and location when it closes and apply those values the next time it starts. If there is a visible plug-in provided dock bar then the plug-in is demand loaded and Rhino checks to see if the dock bar was created then it positions it and displays it as appropriate. If the user hides the dock bar then restarts Rhino and your plug-in shows the dock bar Rhino will hide it causing a flicker on the screen.
Sorry about that, I gave you the wrong host, you should use RhinoWindows.Controls.WpfHost not WpfElementHost. I have attached a simple test plug-in that creates two control bars, one hosting a Windows Forms control and another hosting a WPF control. WpfInControlBar.zip (331.2 KB)