ArcGIS Pro 2.9 API Reference Guide
SetCustomProperties Method

ArcGIS.Desktop.Layouts Namespace > Element Class : SetCustomProperties Method
The collection of custom properties
Sets multiple CustomProperty values for the element. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetCustomProperties( 
   IEnumerable<CIMStringMap> customProperties
)
Public Sub SetCustomProperties( _
   ByVal customProperties As IEnumerable(Of CIMStringMap) _
) 

Parameters

customProperties
The collection of custom properties
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run.
Remarks
This method was created so developers have a way to uniquely assign a value or multiple values to an element that can not be changed in the UI and therefore provides a predictable way to find an element. You can overwrite values simply be reentering the same key with a different value in the input collection. There are no methods to remove keys.
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

Element Class
Element Members