Solved! Go to Solution.
List<string> FieldList = new List<string>() { sFieldName }; ColorRamp colorRamp = new ColorRamp(); colorRamp.Algorithm = Algorithm.CIELabAlgorithm; colorRamp.From = Colors.Black; colorRamp.To = Colors.White; ObservableCollection<ColorRamp> ColorRamps = new ObservableCollection<ColorRamp>() { colorRamp }; UniqueValueDefinition uvDef = new UniqueValueDefinition(); uvDef.Fields = FieldList; uvDef.ColorRamps = ColorRamps; GenerateRendererParameters grParam = new GenerateRendererParameters(); grParam.ClassificationDefinition = uvDef; if (sWhereClause != null) grParam.Where = sWhereClause; GenerateRendererTask grt = new GenerateRendererTask(sUrl); grt.ExecuteCompleted += new EventHandler<GenerateRendererResultEventArgs>(grt_ExecuteCompleted); grt.Failed += new EventHandler<TaskFailedEventArgs>(grt_Failed); grt.ExecuteAsync(grParam, userToken);
GenerateRendererResult grResult = e.GenerateRendererResult; UniqueValueRenderer uvRenderer = (UniqueValueRenderer)grResult.Renderer; List<string> UniqueValues = new List<string>(); foreach (UniqueValueInfo uvInfo in uvRenderer.Infos) { if (uvInfo.Value == null) continue; UniqueValues.Add(uvInfo.Value.ToString()); }