<?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: binding marker symbol in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727223#M18608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can use UniqueValueRenderer and add an Attribute that will detect which symbol it needs to pick up. Instead of setting graphic.Symbol, you can set graphic.Attribute. Here's an example of how UniqueValueRenderer is used in GraphicsLayer. &lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML&lt;/A&gt;. By moving your symbols to a renderer, Legend control should be able to use the symbol and label assigned on the renderer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you both for your help. I have resolved my problem as per Jennifer's method. It was lot simpler than I expected. Thanks a bunch.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Oct 2011 13:27:44 GMT</pubDate>
    <dc:creator>suharthachowdhury</dc:creator>
    <dc:date>2011-10-24T13:27:44Z</dc:date>
    <item>
      <title>binding marker symbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727218#M18603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have several ESRI markersymbols showed on a map layer. Now I want to create a "legend/TOC" like control with the marker symbols and their representative text on it. I don't have a symbol attribute served by the map service, so I really can't use the &lt;/SPAN&gt;&lt;STRONG&gt;SymbolDisplay &lt;/STRONG&gt;&lt;SPAN&gt;property of the toolkit . My symbols are my marker symbols. How can I achieve this? I was planning to create a user control to show my legend-like control. But how can I bind my marker symbols on it? Please share your idea and provide any code-snippet if possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Suhartha&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 15:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727218#M18603</guid>
      <dc:creator>suharthachowdhury</dc:creator>
      <dc:date>2011-10-19T15:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: binding marker symbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727219#M18604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can set GraphicsLayer.Renderer and Legend control will pick up the symbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;!--Under Resources--&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleRenderer x:Key="MyRenderer" Label="Red Symbol"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleRenderer.Symbol&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleMarkerSymbol Color="Red" Size="6" Style="Diamond" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:SimpleRenderer.Symbol&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:SimpleRenderer&amp;gt;
&amp;lt;!--more code goes here--&amp;gt;
&amp;lt;esri:GraphicsLayer ID="CitiesGraphicsLayer" Renderer="{StaticResource MyRenderer}"/&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:05:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727219#M18604</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-12T07:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: binding marker symbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727220#M18605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can set GraphicsLayer.Renderer and Legend control will pick up the symbol.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;!--Under Resources--&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleRenderer x:Key="MyRenderer" Label="Red Symbol"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleRenderer.Symbol&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleMarkerSymbol Color="Red" Size="6" Style="Diamond" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:SimpleRenderer.Symbol&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:SimpleRenderer&amp;gt;
&amp;lt;!--more code goes here--&amp;gt;
&amp;lt;esri:GraphicsLayer ID="CitiesGraphicsLayer" Renderer="{StaticResource MyRenderer}"/&amp;gt;
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Jenni,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. But it's bit different in my case. I cannot really use any renderer for the graphics layer because I do not have a single renderer. The marker symbols are being added to the graphics layer in run-time(from code behind) for each result feature depending on some logic. So what I am doing is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;foreach(Graphic resultFeature in featureSet.Features)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if(somecondition)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;resultFeature&lt;/STRONG&gt;&lt;SPAN&gt;.Symbol = LayoutRoot.Resources["&lt;/SPAN&gt;&lt;STRONG&gt;Non_Detect&lt;/STRONG&gt;&lt;SPAN&gt;"] as Symbol; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Non-Detect is one of my custom marker symbols defined under resources&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--more code goes here--&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.Graphics.Add(&lt;/SPAN&gt;&lt;STRONG&gt;resultFeature&lt;/STRONG&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now with all these marker symbols I want to create the legend-like control to explain the symbols. So it will be a list-like panel that will list all the symbols shown on the map layer with their respective explanation. &lt;/SPAN&gt;&lt;STRONG&gt;My difficulty is to bind the marker symbols on this panel.&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Also I need to know&lt;/STRONG&gt;&lt;SPAN&gt; if it is possible to do this in code-behind so that I can include only those symbols that appear on the map layer on the legend control. Hope I was able to explain the scenario...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:05:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727220#M18605</guid>
      <dc:creator>suharthachowdhury</dc:creator>
      <dc:date>2021-12-12T07:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: binding marker symbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727221#M18606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use UniqueValueRenderer and add an Attribute that will detect which symbol it needs to pick up. Instead of setting graphic.Symbol, you can set graphic.Attribute. Here's an example of how UniqueValueRenderer is used in GraphicsLayer. &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML&lt;/A&gt;&lt;SPAN&gt;. By moving your symbols to a renderer, Legend control should be able to use the symbol and label assigned on the renderer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 21:03:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727221#M18606</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-10-19T21:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: binding marker symbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727222#M18607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;An alternative to Jennifer's solution is to add legend items by code on event 'Refreshed' (Jennifer's solution is better though).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You have to instantiate a new LegendItemViewModel, initialize its label and its imagesource and add it to the LegendItems collection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The difficulty might be to create the imagesource from the symbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The trick is to create a renderer with the symbols and let the renderer create the swatches.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Code example :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
private void Legend_Refreshed(object sender, ESRI.ArcGIS.Client.Toolkit.Legend.RefreshedEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; GraphicsLayer layer = e.LayerItem.Layer as GraphicsLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (layer != null &amp;amp;&amp;amp; layer.ID == "MyGraphics")
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a dummy renderer with the label and symbols to see in the legend
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var renderer = new UniqueValueRenderer();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderer.Infos.Add(new UniqueValueInfo { Label = "RedMarker", Symbol = LayoutRoot.Resources["RedMarkerSymbol"] as Symbol });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderer.Infos.Add(new UniqueValueInfo { Label = "GlobePictureMarker", Symbol = LayoutRoot.Resources["GlobePictureMarkerSymbol"] as Symbol });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderer.Infos.Add(new UniqueValueInfo { Label = "Red Line", Symbol = LayoutRoot.Resources["RedLineSymbol"] as Symbol });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderer.Infos.Add(new UniqueValueInfo { Label = "Carto Line", Symbol = LayoutRoot.Resources["CartoLineSymbol"] as Symbol });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ....... add others symbols
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Query asynchronously the legend infos for this renderer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; renderer.QueryLegendInfos(layerLegendInfo =&amp;gt; CreateLegendItems(e.LayerItem, layerLegendInfo), null);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
private static void CreateLegendItems(LayerItemViewModel layerItem, LayerLegendInfo layerLegendInfo)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Project the legend item infos coming from the renderer (LegendItemInfo) to legend items of the legend control (LegendItemViewModel)
&amp;nbsp;&amp;nbsp;&amp;nbsp; var items = layerLegendInfo.LegendItemInfos.Select(legendItemInfo =&amp;gt; new LegendItemViewModel { Label = legendItemInfo.Label, ImageSource = legendItemInfo.ImageSource });
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerItem.LegendItems = new ObservableCollection&amp;lt;LegendItemViewModel&amp;gt;(items);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See result in attached screenshot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727222#M18607</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-12T07:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: binding marker symbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727223#M18608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can use UniqueValueRenderer and add an Attribute that will detect which symbol it needs to pick up. Instead of setting graphic.Symbol, you can set graphic.Attribute. Here's an example of how UniqueValueRenderer is used in GraphicsLayer. &lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#RenderersXAML&lt;/A&gt;. By moving your symbols to a renderer, Legend control should be able to use the symbol and label assigned on the renderer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you both for your help. I have resolved my problem as per Jennifer's method. It was lot simpler than I expected. Thanks a bunch.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 13:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/binding-marker-symbol/m-p/727223#M18608</guid>
      <dc:creator>suharthachowdhury</dc:creator>
      <dc:date>2011-10-24T13:27:44Z</dc:date>
    </item>
  </channel>
</rss>

