ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Core Namespace / ICatalogWindow Interface / SetContentTypeAsync Method
The catalog content type to be set
Example

In This Topic
    SetContentTypeAsync Method
    In This Topic
    Sets the catalog content type in the catalog dock pane. This method must be called on the UI thread.
    Syntax
    void SetContentTypeAsync( 
       CatalogContentType catalogContentType
    )
    Sub SetContentTypeAsync( _
       ByVal catalogContentType As CatalogContentType _
    ) 

    Parameters

    catalogContentType
    The catalog content type to be set
    Exceptions
    ExceptionDescription
    The calling thread cannot access this object because a different thread owns it
    Remarks
    Specify the catalog content type to be set. The catalog dockpane must be the current active window or the request is ignored. If the catalog dockpane is already showing the specified catalog content type, the request is ignored. Note: This method must be invoked on the UI thread or an System.InvalidOperationException will be thrown.
    This method returns void and cannot be awaited.
    Example
    Set the catalog content type
    //Gets the Catalog pane
    var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
    if (!catalogWindow.IsActiveWindow)
        return; //catalog dockpane must be the active window
    
    //Change the content to whatever is the next tab
    var catContentType = (int)catalogWindow.GetCurrentContentType();
    catContentType++;
    
    if (catContentType > (int)CatalogContentType.Favorites)
        catContentType = (int)CatalogContentType.Project;
    
    //Must be on the UI - no QueuedTask!
    catalogWindow.SetContentTypeAsync((CatalogContentType)catContentType);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also