<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GraphicsLayer Symblol in LegendControl in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689690#M17739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That works perfectly.&amp;nbsp; Thanks Shirley!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Jul 2011 01:00:49 GMT</pubDate>
    <dc:creator>LanceCrumbliss</dc:creator>
    <dc:date>2011-07-23T01:00:49Z</dc:date>
    <item>
      <title>GraphicsLayer Symblol in LegendControl</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689688#M17737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do you bind a symbol to the Legend Control?&amp;nbsp; I understand that this may not be possible considering that it's the graphic itself and not the GraphicsLayer that has a symbol property.&amp;nbsp; If that is the case, then what alternative approaches are there?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 20:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689688#M17737</guid>
      <dc:creator>LanceCrumbliss</dc:creator>
      <dc:date>2011-07-22T20:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicsLayer Symblol in LegendControl</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689689#M17738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Lance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I understand your question correctly, you could assign simplerender to the symbol you use in the graphicslayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is how I did in my application:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In xaml:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;Grid.Resources&amp;gt;
&amp;lt;esri:FillSymbol x:Key="ResultsFillSymbol" Fill="#880000FF"&amp;gt;
&amp;lt;esri:SimpleRenderer x:Key="selectPolygonSymbolRender"&amp;nbsp; Symbol="{StaticResource ResultsFillSymbol}"/&amp;gt;
&amp;lt;/Grid.Resources&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In Code-behind: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
GraphicsLayer graphicsLayer = MyMap.Layers["Selection Results"] as GraphicsLayer;
graphicsLayer.Renderer = LayoutRoot.Resources["selectPolygonSymbolRender"] as SimpleRenderer;
foreach (Graphic feature in featureSet.Features)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.Symbol = LayoutRoot.Resources["ResultsFillSymbol"] as FillSymbol;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.Graphics.Insert(0, feature);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You also need to modify the layerids property of the legend control in code-behind:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if (!MyLegend.LayerIDs.Contains("Selection Results"))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legendIDcount++;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyLegend.LayerIDs.SetValue("Selection Results", legendIDcount);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
//legendIDcount is a global variable defined in the beginning.
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In Xaml:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;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"&amp;nbsp; ShowOnlyVisibleLayers="True" LayerIDs="Visible Layers,a,b,c,d"&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689689#M17738</guid>
      <dc:creator>DanDong</dc:creator>
      <dc:date>2021-12-12T16:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicsLayer Symblol in LegendControl</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689690#M17739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That works perfectly.&amp;nbsp; Thanks Shirley!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jul 2011 01:00:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphicslayer-symblol-in-legendcontrol/m-p/689690#M17739</guid>
      <dc:creator>LanceCrumbliss</dc:creator>
      <dc:date>2011-07-23T01:00:49Z</dc:date>
    </item>
  </channel>
</rss>

