ArcGIS Pro 2.7 API Reference Guide
SaveAsFile Method (Layout)
Example 

ArcGIS.Desktop.Layouts Namespace > Layout Class : SaveAsFile Method
Exports a layout to a new layout (.pagx) file. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SaveAsFile( 
   string fullPathToPagXFile
)
Public Sub SaveAsFile( _
   ByVal fullPathToPagXFile As String _
) 

Parameters

fullPathToPagXFile
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run.
Remarks
A copy of the layout's definition is saved to file. A layout file can be imported into another project using the ItemFactory Class.
Example
//Save a layout to a pagx file.

//Perform on the worker thread
await QueuedTask.Run(() =>
{
  layout.SaveAsFile(filePath);
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Layout Class
Layout Members