<?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 Graphics Layers Behavior in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110322#M2746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;gah, that never occurred to me.&amp;nbsp; i just assumed that there was no relationship between the different graphic layers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Apr 2010 18:45:12 GMT</pubDate>
    <dc:creator>LanceCrumbliss</dc:creator>
    <dc:date>2010-04-28T18:45:12Z</dc:date>
    <item>
      <title>Graphics Layers Behavior</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110320#M2744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ive got two symbols and two graphics layers defined in xaml as such:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;lt;Grid.Resources&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriSymbols:SimpleMarkerSymbol x:Name="DefaultMarkerSymbol" Size="8" Color="#DD00FFFF"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esriSymbols:SimpleMarkerSymbol x:Name="HighlightMarkerSymbol" Size="10" Color="#DDFF0000"/&amp;gt;
&amp;lt;/Grid.Resources&amp;gt;

&amp;lt;esri:Map x:Name="Map"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Map.Layers&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="FindLayer" Visible="False" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="HighlightLayer" Visible="False"/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Map.Layers&amp;gt;
&amp;lt;/esri:Map&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "FindLayer" shows all of the results returned from a Find task and displays the "DefaultMarkerSymbol" for each result returned fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Called when the FindTask Task is completed and contains valid results
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub ShowResultsOnMap(ByVal results As List(Of FindResult))
&amp;nbsp; Dim findLayer As GraphicsLayer = TryCast(Map.Layers("FindLayer"), GraphicsLayer)
&amp;nbsp; Dim graphicsList As New List(Of Graphic)

&amp;nbsp; For Each fr As FindResult In results
&amp;nbsp;&amp;nbsp; graphicsList.Add(fr.Feature)
&amp;nbsp; Next

&amp;nbsp; For Each foundFeature As Graphic In graphicsList
&amp;nbsp;&amp;nbsp; foundFeature.Symbol = DefaultMarkerSymbol 'Defined in XAML
&amp;nbsp;&amp;nbsp; findLayer.Graphics.Add(foundFeature)
&amp;nbsp; Next

&amp;nbsp; findLayer.Visible = True
 End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; When selecting a result from the listbox that the attributes are displayed in, the "HighlightLayer" shows the larger, "HighlightMarkerSymbol" on top.&amp;nbsp; It works fine for the first selection, but for some reason each subsequent selection simply&amp;nbsp; highlights the selection without removing the previous one.&amp;nbsp; it's like the "ClearGraphics" method doesn't work....but it does.&amp;nbsp; the collection is clear, but the symbol seems to persist on the "HighlightLayer" graphics layer.&amp;nbsp; this will happen for each subsequent selection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; Private Sub lbFoundFeatures_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs)

&amp;nbsp; Dim highlightLayer As GraphicsLayer = TryCast(Map.Layers("HighlightLayer"), GraphicsLayer)
&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; highlightLayer.ClearGraphics()

&amp;nbsp; Try
&amp;nbsp;&amp;nbsp; Dim selectedListBoxItem As ESRI.ArcGIS.Client.Tasks.FindResult = TryCast(e.AddedItems(0), ESRI.ArcGIS.Client.Tasks.FindResult)
&amp;nbsp;&amp;nbsp; Dim selectedFeature As Graphic = selectedListBoxItem.Feature
&amp;nbsp;&amp;nbsp; selectedFeature.Symbol = HighlightMarkerSymbol 'Defined in XAML
&amp;nbsp;&amp;nbsp; highlightLayer.Visible = True
&amp;nbsp;&amp;nbsp; highlightLayer.Graphics.Add(selectedFeature)
&amp;nbsp; Catch ex As Exception
&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; 'Cathes error when e.AddItems is Nothing
&amp;nbsp; End Try
 End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oddly, if i never call the ShowResultsOnMap sub (so that the results are not highlighted in cyan upon the FindTask completion), then the highlighting works fine; when a result is selected in the listbox, the corresponding red dot appears on the map.&amp;nbsp; selecting a different result removes the previous and shows the newly selected one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;does anyone know what's going on?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 15:43:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110320#M2744</guid>
      <dc:creator>LanceCrumbliss</dc:creator>
      <dc:date>2010-04-28T15:43:16Z</dc:date>
    </item>
    <item>
      <title>Graphics Layers Behavior</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110321#M2745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks like you affect the same graphic to 2 graphics layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By changing the symbology of one graphic, you are changing it for the two layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to manage only one graphics layer and when the selection changes, reset the symbol of the previous selection to 'DefaultMarkerSymbol'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 17:39:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110321#M2745</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2010-04-28T17:39:22Z</dc:date>
    </item>
    <item>
      <title>Graphics Layers Behavior</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110322#M2746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;gah, that never occurred to me.&amp;nbsp; i just assumed that there was no relationship between the different graphic layers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 18:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/graphics-layers-behavior/m-p/110322#M2746</guid>
      <dc:creator>LanceCrumbliss</dc:creator>
      <dc:date>2010-04-28T18:45:12Z</dc:date>
    </item>
  </channel>
</rss>

