ArcGIS Pro 2.7 API Reference Guide
GetMapView Method
Example 

ArcGIS.Desktop.Layouts Namespace > MapFrame Class : GetMapView Method
Gets the map Frame's viewer on the specified layout pane.
Syntax
public MapView GetMapView( 
   LayoutView layoutView
)
Public Function GetMapView( _
   ByVal layoutView As LayoutView _
) As MapView

Parameters

layoutView

Return Value

Returns a MapView.
Remarks
Note: the layout pane containing the viewer must be open. To navigate the map frame without an open layout pane, use the map frame's camera instead.
Example
//Export the map view associated with a map frame to BMP.

//Create BMP format with appropriate settings
//EMF, EPS, GIF, JPEG, PDF, PNG, SVG, TGA, and TFF formats are also available for export
BMPFormat BMP = new BMPFormat()
{
  Resolution = 300,
  Height = 500,
  Width = 800,
  HasWorldFile = true,
  OutputFileName = filePath
};

//Reference the active layout view
LayoutView lytView = LayoutView.Active;

//Reference the map frame and its map view
MapFrame mf_bmp = layout.FindElement("Map Frame") as MapFrame;
MapView mv_bmp = mf_bmp.GetMapView(lytView);

if (mv_bmp != null)
{
  //Export on the worker thread
  await QueuedTask.Run(() =>
  {

    //Check to see if the path is valid and export
    if (BMP.ValidateOutputFilePath())
    {
      mv_bmp.Export(BMP);  //Export to BMP
    }
  });
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapFrame Class
MapFrame Members