Panels.PanelDockBar(...) always returning null

Hello, I’m trying to retrieve the container where a custom Panel is docked.

Panels.PanelDockBar(typeof(MyCustomPanel)) always returns null, even if the given panel is actually docked in a container.
Does PanelDockBar work for custom panels?

To provide a little context: what I want to achieve is to show a custom panel, if some plugin data is processed while reading a file being opened. The panel should:

  • Be opened as a floating panel if it is not already docked somewhere (this is easily achieved with Panels.OpenPanel(...) )
  • Be set as selected tab in its containing docking bar otherwise (how can I do that?)

Thanks for any ideas.

– Paolo

@johnm - is this something you can help with?

Paolo,
I made a test command using the following code that will open a custom panel in a floating container if it is not currently visible and selected in another container.

      if (!Panels.IsPanelVisible(typeof(MultiDocPanel), true))
        Panels.OpenPanel(Guid.Empty, typeof(MultiDocPanel).GUID, true);

Help for the Panels class can be found here.
This is the description of the form of IsPanelVisible I used.

Thanks @JohnM , that works as I intended. :ok_hand: