await QueuedTask.Run(() =>
{
var fields = new List<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 = flyr.CreateRenderer(uniqueValueRendererDef) as CIMUniqueValueRenderer;
//setting the renderer to the feature layer
flyr.SetRenderer(uniqueValueRenderer);
});