ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / CanSetMapTOCContent Method
The content type to check for
Example

In This Topic
    CanSetMapTOCContent Method
    In This Topic
    Gets whether the specified map TOC content type can be set on the active TOC.
    Syntax
    public bool CanSetMapTOCContent( 
       MapTOCContentType mapTOCContentType
    )
    Public Function CanSetMapTOCContent( _
       ByVal mapTOCContentType As MapTOCContentType _
    ) As Boolean

    Parameters

    mapTOCContentType
    The content type to check for

    Return Value

    Returns true if the requested content type is present in the TOC. Otherwise false.
    Remarks
    If the active TOC is not a map TOC, false will always be returned. Note: As link charts use a map TOC, CanSetMapTOCContent(...) can be used when a link chart is the active "map" view
    Example
    Set the Active Map TOC content type
          //Get the current active TOC content type for the map view 
          var mapTOCContentType = (int)MapView.Active.CurrentMapTOCContent;
    //increment to the next tab whatever it is
    mapTOCContentType++;
    //Can we set this type on the TOC?
          if (MapView.Active.CanSetMapTOCContent((MapTOCContentType)mapTOCContentType))
      //Set it - must be on the UI! - No QueuedTask
              MapView.Active.SetMapTOCContentAsync((MapTOCContentType)mapTOCContentType);
    else
    {
              mapTOCContentType = (int)MapTOCContentType.DrawingOrder;
              //Set it - must be on the UI! - No QueuedTask
              MapView.Active.SetMapTOCContentAsync((MapTOCContentType)mapTOCContentType);
          }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also