I have a requirement to support custom symbology for each user based on attribute values. I am trying to use the UniqueValueRenderer to accomplish this, but I ran into a problem where UniqueValueRender.Infos property is read-only. This limits my ability in code to set up user-defined symbology.
Typically I'm seeing UniqueValueRender defined statically as a resource as shown below. I am trying to use code because I can't possibly statically define all the possible permutations between color, fill and attribute values.
Is there any way around this?
<Grid.Resources>
<esriSymbols:SimpleFillSymbol x:Name="MyGreenFillSymbol" Fill="#6600FF00" BorderBrush="Green"
BorderThickness="2" />
<esriSymbols:SimpleFillSymbol x:Name="MyYellowFillSymbol" Fill="#66FFFF00"
BorderBrush="Yellow" BorderThickness="2" />
<esriSymbols:SimpleFillSymbol x:Name="MyRedFillSymbol" Fill="#66FF0000" BorderBrush="Red"
BorderThickness="2" />
<esri:UniqueValueRenderer x:Name="MyUniqueValueRenderer" Attribute="STATE_NAME" >
<esri:UniqueValueRenderer.Infos>
<esri:UniqueValueInfo Value="California" Symbol="{StaticResource MyGreenFillSymbol}" />
<esri:UniqueValueInfo Value="New York" Symbol="{StaticResource MyYellowFillSymbol}" />
<esri:UniqueValueInfo Value="Kansas" Symbol="{StaticResource MyRedFillSymbol}" />
</esri:UniqueValueRenderer.Infos>
</esri:UniqueValueRenderer>
</Grid.Resources>