Parameters
- mapFrame
- The map frame to activate
| Exception | Description |
|---|---|
| System.ArgumentException | Map frame cannot be activated |
| System.InvalidOperationException | Needs to run on the GUI thread |
| System.InvalidOperationException | Layout view must be the active view |
{
//We can activate a map frame on the layout of the active view
var map_frame = layout.GetElementsAsFlattenedList()
.OfType<MapFrame>().FirstOrDefault(mf => mf.Name == "Map 1");
if (map_frame == null)
return;
//can we activate the map frame?
if (layoutView.CanActivateMapFrame(map_frame))
//activate it - Note: we are on the UI thread!
layoutView.ActivateMapFrame(map_frame);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)