I have a dockpane that displays selected items in a data grid and allows the user to select a row and open it's asset information in SAP. After checking if the SAP connexion is valid I set a state. I've set the condition on the button that opens the dockpane, which works fine, but if the pane is already open, it remains open in the interface.
I was wondering if it is possible to close a dockpane or disable it's controls based on a state/condition value?
Thank you,
Benoit
Hi Benoit
Just some clarification to understand your issue -
When you open an ArcGIS Pro project, it remembers the Dockpanes that were open previously. So in your case, when the project opens up, the SAP connection is not valid, but still the controls in your Dockpane are visible\enabled. Is this what you are trying to solve?
Thanks
Uma
Hi Uma, this is exactly what I'm trying to solve.
Thanks
Hi Benoit
You can accomplish this by:
Thanks
Uma
Thank you Uma,
I was hoping for a less "code behind" solution but I guess I will manage something your solution.
Benoit
Hi Benoit
Correction: You do not have to set the autoload property to true in your example. The add-in should work with this property set to false (default value).
Thanks
Uma
I would like to hide the dockpane completely when the Pro client is launched. I have tried overriding the InitializeAsync() and calling the hide method on the DockPane object, but it still appears. Is there no way to hide a dockpane if it was open during the previous session of Pro?
I have the same question as Leslie. I want my dockpane to be closed when the project is opened. I solved this problem by closing the dockpane when ArcGIS Pro is shut down. I use the following code in my module:
protected override bool CanUnload()
{
DockPane dockPane = FrameworkApplication.DockPaneManager.Find(_myDockPaneID);
if (dockPane != null)
{
dockPane.IsVisible = false;
}
return true;
}