ArcGIS Pro 3.4 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 void MoveBookmark( 
       Bookmark bookmark,
       int newIndex
    )
    Public Sub MoveBookmark( _
       ByVal bookmark As Bookmark, _
       ByVal newIndex As Integer _
    ) 

    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
    public Task MoveBookmarkToTopAsync(Map map, string name)
    {
      return QueuedTask.Run(() =>
      {
        //Find the first bookmark with the name
        var bookmark = map.GetBookmarks().FirstOrDefault(b => b.Name == name);
        if (bookmark == null)
          return;
    
        //Remove the bookmark
        map.MoveBookmark(bookmark, 0);
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also