can I add controls to dock pane in code?

07-22-2021 01:20 PM
New Contributor II

I'm trying to build an addin where a user can select features from a map layer and the attribute data associated with the selected features would be displayed in a textarea on the dock pane, with adjacent buttons to copy the content to clipboard. Our users need for each selected feature to have its own textarea/buttons so I can't just create them at design time.

In ArcGIS Desktop I can create new textboxes and buttons and add them to a FlowLayoutPanel, but I don't think that is available in Pro API. Can anyone help?

0 Kudos
2 Replies
New Contributor III

I suggest you look into ItemsControl in WPF to describe the basic process of adding a list of items to your UI surface. A tutorial introduction, such as this one..., may be helpful in getting started (many others available).  From a high level you set the ItemSource of the ItemsControl to be a Collection of items and you dynamically (at run time) fill in this list of these types (one per feature or whatever you want to show on the UI)  Then the ItemTemplate controls how each of these is rendered...

0 Kudos
by Esri Regular Contributor
Esri Regular Contributor

There is a sample that is using a dockpane with a 'tab control' showing a table control for multiple feature layers:  arcgis-pro-sdk-community-samples/Map-Exploration/TableControlsDockpane at master · Esri/arcgis-pro-s...

I guess you would like to only show the actual selected items which is possible with minor modifications.

0 Kudos