ArcGIS Pro 2.7 API Reference Guide
SetMap Method
Example 

ArcGIS.Desktop.Layouts Namespace > MapFrame Class : SetMap Method
Camera
Sets the Map associated with the MapFrame. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetMap( 
   Map map
)
Public Sub SetMap( _
   ByVal map As Map _
) 

Parameters

map
Camera
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
//Change the map associated with a map frame

//Reference a map frame on a layout
MapFrame mfrm = layout.FindElement("Map Frame") as MapFrame;

//Peform on worker thread
await QueuedTask.Run(() =>
{
  //Reference map from the project item 
  Map map = Project.Current.GetItems<MapProjectItem>().FirstOrDefault(m => m.Name.Equals("Map1")).GetMap();

  //Set the map to the map frame
  mfrm.SetMap(map);
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapFrame Class
MapFrame Members