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

ArcGIS.Desktop.Layouts Namespace > Layout Class : SetDefinition Method
CIMLayout
Applies the changes made to a modified ArcGIS.Core.CIM.CIMLayout back to the element on the page layout. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetDefinition( 
   CIMLayout cimLayout
)
Public Sub SetDefinition( _
   ByVal cimLayout As CIMLayout _
) 

Parameters

cimLayout
CIMLayout
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run.
Example
//Modify a layout's CIM definition

//Perform on the worker thread
await QueuedTask.Run(() =>
{
  CIMLayout cimLayout = layout.GetDefinition();

  //Do something

  layout.SetDefinition(cimLayout);
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Layout Class
Layout Members