Hi Lance,If I understand your question correctly, you could assign simplerender to the symbol you use in the graphicslayer.Here is how I did in my application:In xaml:
<Grid.Resources>
<esri:FillSymbol x:Key="ResultsFillSymbol" Fill="#880000FF">
<esri:SimpleRenderer x:Key="selectPolygonSymbolRender" Symbol="{StaticResource ResultsFillSymbol}"/>
</Grid.Resources>
In Code-behind:
GraphicsLayer graphicsLayer = MyMap.Layers["Selection Results"] as GraphicsLayer;
graphicsLayer.Renderer = LayoutRoot.Resources["selectPolygonSymbolRender"] as SimpleRenderer;
foreach (Graphic feature in featureSet.Features)
{
feature.Symbol = LayoutRoot.Resources["ResultsFillSymbol"] as FillSymbol;
graphicsLayer.Graphics.Insert(0, feature);
}
You also need to modify the layerids property of the legend control in code-behind:
if (!MyLegend.LayerIDs.Contains("Selection Results"))
{
legendIDcount++;
MyLegend.LayerIDs.SetValue("Selection Results", legendIDcount);
}
//legendIDcount is a global variable defined in the beginning.
Make sure to leave the place for the new graphicslayer. If you don't put a, b,c,d in the layerids property, it looks like new id couldn't be added. In Xaml:
<esri:Legend x:Name="MyLegend" Map="{Binding ElementName=MyMap}" Grid.Row="2" Background="#FFFFFFCC" BorderBrush="#FFFFFFCC" HorizontalAlignment="Left" Margin="3,3" Width="260"
LayerItemsMode="Flat" ShowOnlyVisibleLayers="True" LayerIDs="Visible Layers,a,b,c,d">
Hope this helps.