ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / MoveBookmark Method
The bookmark to move.
The new index to move the bookmark to.
Example

In This Topic
    MoveBookmark Method
    In This Topic
    Moves the bookmark to a new index in the map's collection of bookmarks. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub MoveBookmark( _
       ByVal bookmark As Bookmark, _
       ByVal newIndex As Integer _
    ) 
    public void MoveBookmark( 
       Bookmark bookmark,
       int newIndex
    )

    Parameters

    bookmark
    The bookmark to move.
    newIndex
    The new index to move the bookmark to.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Move Bookmark to the Top
    {
      // Note: Needs QueuedTask to run
      {
        var map = mapView.Map;
        //Find the first bookmark with the name
        var bookmark = map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
        if (bookmark == null)
        {
          //Bookmark not found
        }
    
        //Move the bookmark to the top of the list
        map.MoveBookmark(bookmark, 0);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also