Hi,
It seems dock pane is sticky and seems to remain opened after opening it once. It will remain still open when creating a new project when an existing project is opened (so basically when moved from opened to a new project).
In my use case my dock pane will be opened when certain feature layers are added to the map. If not then the dock pane button will be disabled using state/condition. So for example I have created a project for the first time and added all the required layers to the map which will enable the button to open the dock pane. But now if I will create or move from that project and create a new one which will definitely not having the required layers. As per the implementation the button is disabled. But the problem is the dock pane is already opened besides the usual dock panes like Attributes, Catalog etc.
I tried to check my condition and then try to hide the dock pane but it is still there.
FrameworkApplication.DockPaneManager.Find("MyDockpaneId")?.Hide();
What is the best way to hide or close the dock pane in this use case?
@Wolf @GKmieliauskas @CharlesMacleod