ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMGeoFeatureLayerBase Class / Renderer Property
Example

In This Topic
    Renderer Property (CIMGeoFeatureLayerBase)
    In This Topic
    Gets or sets the primary symbol renderer.
    Syntax
    public CIMRenderer Renderer {get; set;}
    Public Property Renderer As CIMRenderer
    Example
    Apply Symbology to a layer from a Layer file
    //Note: Run within QueuedTask.Run
    //Get the Layer Document from the lyrx file
    var lyrDocFromLyrxFile = new LayerDocument(layerFile);
    var cimLyrDoc = lyrDocFromLyrxFile.GetCIMLayerDocument();
    
    //Get the renderer from the layer file
    var rendererFromLayerFile = ((CIMFeatureLayer)cimLyrDoc.LayerDefinitions[0]).Renderer as CIMUniqueValueRenderer;
    
    //Apply the renderer to the feature layer
    //Note: If working with a raster layer, use the SetColorizer method.
    featureLayer?.SetRenderer(rendererFromLayerFile);
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also