ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ILayerFactory Interface / CanCreateLayer<T> Method
Expected Layer Type
Can be one of LayerCreationParams derived objects.
A map or group layer instance to which the Layer will be added.

In This Topic
    CanCreateLayer<T> Method (ILayerFactory)
    In This Topic
    Indicates whether a layer can be created using the specified LayerCreationParams and added to the container. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    layerParams
    Can be one of LayerCreationParams derived objects.
    container
    A map or group layer instance to which the Layer will be added.

    Type Parameters

    T
    Expected Layer Type

    Return Value

    A boolean indicates that a layer can be created.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    LayerCreationParams or container is null.
    Cannot create the layer of the specified type with the set of LayerCreationParams.
    Remarks
    You should use this method before passing an item to LayerFactory.CreateLayer<T>
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.3 or higher.
    See Also