ArcGIS Pro 2.6 API Reference Guide
SetName Method (Element)
Example 

ArcGIS.Desktop.Layouts Namespace > Element Class : SetName Method
String
Sets the name of the element. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetName( 
   string name
)
Public Sub SetName( _
   ByVal name As String _
) 

Parameters

name
String
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run.
Remarks
All elements on a layout must have a unique name so they can be easily referenced.
Example
//Modify an element's name.

//Perform on the worker thread
await QueuedTask.Run(() =>
{
  element.SetName("New Name");
});
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

Element Class
Element Members