ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / LayoutView Class / ActivatedMapFrame Property
Example

In This Topic
    ActivatedMapFrame Property
    In This Topic
    Gets the activated map frame or null if a map frame is not activated
    Syntax
    public MapFrame ActivatedMapFrame {get;}
    Public ReadOnly Property ActivatedMapFrame As MapFrame

    Property Value

    MapFrame
    Remarks
    Only one map frame on the view can be activated at any given time
    Example
    Deactivate Map Frame
    //The active view must be a layout view.
    var lv = LayoutView.Active;
    if (lv == null)
      return;
    var layout = lv.Layout;
    if (layout == null)
      return;
    
    //Deactivate any activated map frame
    //Note: we are on the UI thread!
    lv.DeactivateMapFrame();//no-op if nothing activated
    
    //or - check if a  map frame is activated first...
    if (lv.ActivatedMapFrame != null)
      //Note: we are on the UI thread!
      lv.DeactivateMapFrame();
    
    Get the Activated Map Frame and MapView
    //The active view must be a layout view.
    var lv = LayoutView.Active;
    if (lv == null)
      return;
    
    var map_view = lv.ActivatedMapView;
    if (map_view != null)
    {
      //TODO - use activated map view
    }
    var map_frame = lv.ActivatedMapFrame;
    if (map_frame != null)
    {
      //TODO - use activated map frame
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also