CanSetMapTOCContent Method
Gets whether the specified map TOC content type can be set on the
active TOC.
Parameters
- mapTOCContentType
- The content type to check for
Return Value
Returns true if the requested content type is present in the TOC. Otherwise false.
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);
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.6 or higher.