

{
ProApp.Panes.OfType<IMapPane>().OrderBy((mp) => mp.MapView.Map.URI ?? mp.MapView.Map.Name);
}
{
//Gets the unique list of Maps from all the MapPanes.
//Note: The list of maps retrieved from the MapPanes
//maybe less than the total number of Maps in the project.
//It depends on what maps the user has actually opened.
var mapPanes = ProApp.Panes.OfType<IMapPane>()
.GroupBy((mp) => mp.MapView.Map.URI).Select(grp => grp.FirstOrDefault());
List<Map> uniqueMaps = new List<Map>();
foreach (var pane in mapPanes)
uniqueMaps.Add(pane.MapView.Map);
}
{
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)