{
string mapPaneCaption = "USNationalParks";
IMapPane mapViewPane = FrameworkApplication.Panes.OfType<IMapPane>().FirstOrDefault((p) => p.Caption == mapPaneCaption);
mapView = null;
if (mapViewPane != null)
{
// activate the MapPane
(mapViewPane as Pane).Activate();
if (mapView != null)
{
// get the layers selected in the map's TOC
var selectedLayers = mapView.GetSelectedLayers();
}
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)