ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / FeatureLayer Class / AddSymbolLayerDrawing Method
Example

In This Topic
    AddSymbolLayerDrawing Method (FeatureLayer)
    In This Topic
    Add Symbol Layer Drawing, SLD, to the feature layer. After adding SLD it will be enabled.This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void AddSymbolLayerDrawing()
    Public Sub AddSymbolLayerDrawing() 
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    SLD cannot be added to this layer
    Remarks
    Use CanAddSymbolLayerDrawing to determine if the feature layer can have SLD added. If SLD cannot be added an System.InvalidOperationException will be thrown.
    Example
    Add SLD
    QueuedTask.Run(() =>
    {
      //check if it can be added to the layer
      if (featLayer.CanAddSymbolLayerDrawing())
        featLayer.AddSymbolLayerDrawing();
    
      //ditto for a group layer...must have at least
      //one child feature layer that can participate
      if (groupLayer.CanAddSymbolLayerDrawing())
        groupLayer.AddSymbolLayerDrawing();
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also