I am creating some tools nested in a Dockpane. I would like to see if I can detect the status of the Dockpane. Whether Dockpane is on and in the main view or not turned on at all and it needs to be turned on via Add-In tab.
When a user initiates it, some layers will be added to TOC automatically. However, if it is already on and ready user will load the layers manually via a button maybe.
My idea is to give a better experience to end-users. When a user initiates the Dockpane s/he most likely to use those layers however if the Dockpane is on when Pro started it does not mean a user will utilize those layers or the tools within the Dockpane.
Please let me know if you have a better/alternative way to handle this type of situation.
Solved! Go to Solution.
First you should use:
var pane = FrameworkApplication.DockPaneManager.Find(name);
This will attempt to find the dock pane with the given name.
If pane is not null, it was found. Then you can use:
FrameworkApplication.DockPaneManager.IsVisible(name)
where "name" is the name of your DockPane. It will tell you if the dock pane is visible or not.
The null check is not strictly required but I found that it works better if you try not to get a dock pane that doesn't exist.
HTH.
Kris
First you should use:
var pane = FrameworkApplication.DockPaneManager.Find(name);
This will attempt to find the dock pane with the given name.
If pane is not null, it was found. Then you can use:
FrameworkApplication.DockPaneManager.IsVisible(name)
where "name" is the name of your DockPane. It will tell you if the dock pane is visible or not.
The null check is not strictly required but I found that it works better if you try not to get a dock pane that doesn't exist.
HTH.
Kris
Works like a charm - Thanks.