ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / MoveLayer Method / MoveLayer(Layer,Int32) Method
A layer.
The position specified by the 0-based index. -1 will move the layer the bottom of the map. If the index is invalid, the layer is moved to the bottom.
Version

MoveLayer(Layer,Int32) Method
Moves a layer to a different position in the table of contents. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void MoveLayer( 
   Layer layer,
   int position
)

Parameters

layer
A layer.
position
The position specified by the 0-based index. -1 will move the layer the bottom of the map. If the index is invalid, the layer is moved to the bottom.
Exceptions
ExceptionDescription
The layer is null.
This method or property must be called within the lambda passed to QueuedTask.Run.
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also