{
var mapPanes = FrameworkApplication.Panes.OfType<IMapPane>();
foreach (Pane p in mapPanes.Cast<Pane>())
{
if (p.Caption == paneID)
{
p.Activate();
break;
}
}
}
{
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();
}
}
}
{
//Note: Needs QueuedTask to run
Report reportToActivate = Project.Current.GetItems<ReportProjectItem>().FirstOrDefault().GetReport();
var reportPane = FrameworkApplication.Panes.FindReportPanes(report).Last();
if (reportPane == null)
return;
//Activate the pane
(reportPane as ArcGIS.Desktop.Framework.Contracts.Pane).Activate();
//Get the "ReportView" associated with the Report Pane.
ReportView reportViewFromPane = reportPane.ReportView;
}
{
//Activate an already open layout view.
//A layout view may be open but it may not be active.
//Find the pane that references the layout and activate it.
//Note - there can be multiple panes referencing the same layout.
foreach (var pane in ProApp.Panes)
{
var layoutPane = pane as ILayoutPane;
if (layoutPane == null) //if not a layout view, continue to the next pane
continue;
if (layoutPane.LayoutView.Layout == layout) //activate the view
{
(layoutPane as Pane).Activate();
return;
}
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)