Connect Add-in Pane to active map?

4902
17
07-17-2016 08:46 AM
by Anonymous User
Not applicable

I am displaying a data grid of custom information in my Pro add-in.  I have added this to a pane, however, when this pane is activated, the Contents dock pane is empty until a map view is again set as the active pane.  I would like the Contents to remain populated with layers from the active map view, similar to how charts and attribute table panes work.  When I add the data grid to a dock pane instead of a ViewStatePane, I do get this behavior, but then I cannot dock this pane to the map view. Is there a way to do this? 

0 Kudos
17 Replies
CharlesMacleod
Esri Regular Contributor

Dockpane is the correct way to go. The best you can do on the docking is dock to the application window (left, right, top, bottom) - it does not support docking to a Pane (map, layout, etc) as you mention.

Conceptually, Pro has an Active pane (the one with focus). The TOC (amongst other things) keys off this and changes its contents to match whichever pane is active. Therefore, when you try to use a Pane (and not a ~dock~ pane), even though you get the docking behavior you want, activating your Pane de-activates the previously active pane (eg a map) and the TOC, seeing that ~your~ pane is not a mapview, it empties.

There are special cases in Pro where the context needs to be maintained even though a MapView does not have focus. For example, if you open a layer attribute table the TOC remains unchanged and the MapView.Active property is still valid. In this case, the table pane instance (hosting the attribute table) is providing the proper context to the TOC (for the mapview that contains the layer whose attributes are being shown) to keep the TOC populated. However, the code to do that is all internal and is not exposed in the API. Currently there are no plans to support this.

0 Kudos
Jan-Tschada
Esri Contributor

There is a need for using custom panes connected to the map view like the attribute table is already doing.

Product Manager
Developers and Location Services
Germany and Switzerland
0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Jan,

 I updated the Layer Pane sample which I think does what you need: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/LayersPane
 Can you check the sample and see if it satisfies your workflow needs?
Layer Pane sample

Jan-Tschada
Esri Contributor

Hi Wolfgang,

I pulled your changes from the last commit "Simplified code to manage DataGrid control", but I cannot see any major changes to the view model acting as a view pane. Would you be so kind and validate if you pushed the changes you made to the public repository or maybe it is just committed to your local one?

Product Manager
Developers and Location Services
Germany and Switzerland
0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Jan,

 I misunderstood the original question, even with the updated sample the 'Contents' dockpane's TOC is 'emptied' when the 'Pane' is activated.  Sorry about the confusion. So Charlie's answer from above stands: currently this feature is not supported.

Layer Pane sample

CharlesMacleod
Esri Regular Contributor

We will look at supporting this for next release.

JodiLuostarinen
New Contributor II

Is there an update to this issue?  I am using the Pro SDK 1.4.1 and just want to programmatically open (show) the attribute table from a standalone table listed in the TOC.  Thanks.

0 Kudos
UmaHarano
Esri Regular Contributor

Hi

This will be possible with the 2.0 release of the Pro SDK.  We anticipate 2.0 to be released end of June.  There will be a new Visual Studio item template that can be used to create a pane that is linked to an active map.  When 2.0 is released, there will be Pro SDK Samples and guides to help with this.

In the meantime, you could download the ArcGIS Pro 2.0 Beta to experiment with this functionality to get ready for the final release.

Thanks

Uma

JodiLuostarinen
New Contributor II

Thank you very much for the quick reply and update.

Jodi Luostarinen

CEO Quartic Solutions

1804 Garnet Ave. #447

San Diego, CA 92109

mobile: (619) 602-7606

www.quarticsolutions.com

0 Kudos