ArcGIS Pro 2.9 API Reference Guide
CreateRenderer Method (FeatureLayer)
Example 

ArcGIS.Desktop.Mapping Namespace > FeatureLayer Class : CreateRenderer Method
A renderer definition object.
Creates a renderer to a feature layer using a RendererDefinition. This method must be called on the MCT. Use QueuedTask.Run
Syntax
Public Function CreateRenderer( _
   ByVal rendererDefinition As RendererDefinition _
) As CIMRenderer

Parameters

rendererDefinition
A renderer definition object.

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
Set unique value renderer to the selected feature layer of the active map.
await QueuedTask.Run(() =>
{
  String[] fields = new string[] { "Type" }; //field to be used to retrieve unique values
  CIMPointSymbol pointSym = SymbolFactory.Instance.ConstructPointSymbol(
            ColorFactory.Instance.GreenRGB, 16.0, SimpleMarkerStyle.Pushpin);  //constructing a point symbol as a template symbol
  CIMSymbolReference symbolPointTemplate = pointSym.MakeSymbolReference();

  //constructing renderer definition for unique value renderer
  UniqueValueRendererDefinition uniqueValueRendererDef = new UniqueValueRendererDefinition(fields, symbolPointTemplate);

  //creating a unique value renderer
  var flyr = MapView.Active.GetSelectedLayers()[0] as FeatureLayer;
  CIMUniqueValueRenderer uniqueValueRenderer = (CIMUniqueValueRenderer)flyr.CreateRenderer(uniqueValueRendererDef);

  //setting the renderer to the feature layer
  flyr.SetRenderer(uniqueValueRenderer);
});
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

FeatureLayer Class
FeatureLayer Members