<?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: Legend Control stop to refresh in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710780#M18248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are two kinds of refresh and I am not sure which one you are talking about:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) Refresh visibility of legend items : If ShowOnlyVisibleLayers is set to true, the item visibilities may change when zooming. To avoid this kind of refresh you can set ShowOnlyVisibleLayers to false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) Refresh when the legend of a layer changed (which is raising the event 'Refreshed'). This happens mainly when the layer is initializing (i.e. once) and then this happens when the legend of the layer changed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no easy way to stop this kind of refresh but note that the first refresh is mandatory (else no legend items) and then the refresh events are very unfrequent (e.g the legend of an ArcGISDynamicMapServciceLayer never changes and&amp;nbsp; the legend of a feature layer changes only if one modifies the renderer). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What is your use case for stopping the legend to refresh?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Mar 2011 09:30:37 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2011-03-25T09:30:37Z</dc:date>
    <item>
      <title>Legend Control stop to refresh</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710779#M18247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm wondering if there's any way I can stop Legend Control to refresh?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 17:52:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710779#M18247</guid>
      <dc:creator>AlexanderKhoroshun</dc:creator>
      <dc:date>2011-03-24T17:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Control stop to refresh</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710780#M18248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are two kinds of refresh and I am not sure which one you are talking about:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1) Refresh visibility of legend items : If ShowOnlyVisibleLayers is set to true, the item visibilities may change when zooming. To avoid this kind of refresh you can set ShowOnlyVisibleLayers to false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2) Refresh when the legend of a layer changed (which is raising the event 'Refreshed'). This happens mainly when the layer is initializing (i.e. once) and then this happens when the legend of the layer changed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no easy way to stop this kind of refresh but note that the first refresh is mandatory (else no legend items) and then the refresh events are very unfrequent (e.g the legend of an ArcGISDynamicMapServciceLayer never changes and&amp;nbsp; the legend of a feature layer changes only if one modifies the renderer). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What is your use case for stopping the legend to refresh?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 09:30:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710780#M18248</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-03-25T09:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Control stop to refresh</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710781#M18249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason why I'm asking how to stop legend refresh is that Lagend control refreshes not only in these two cases.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 'Navigation' toolbar in my application and I'm using Draw object for 'Zoom-In' tool to draw rectangle. There are several another tools which use different Draw objects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I changed something in Legend control (expanded some layers/sublayers, changed visibility, etc.) and then clicking some tool in toolbar it causes Legend control to refresh and I'm loosing all changes I did in TOC. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did some reasearch and found that Legend refresh happens when I'm changing some Draw object's properties in my code (for exaample, if I'm switching _myDrawObject.IsEnabled from true to false).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks for me like a third&amp;nbsp; kind of refresh... and I have to find some way how to prevent this type of refresh.&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;Alexander.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 15:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710781#M18249</guid>
      <dc:creator>AlexanderKhoroshun</dc:creator>
      <dc:date>2011-03-25T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Control stop to refresh</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710782#M18250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahh, yes I see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's because some tools can add internal layers so the legend is refreshed since this layer is added to the legend.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AFAIK these internal layers will no more be visible from version 2.2. If you have the opportunity to test with 2.2, let us know the result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One workaround might be to set the LayerIds property with all the layers of your map. This will exclude the internal layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That being said, it's not normal that you loose the changes you did in the TOC. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you changed the visibility of a layer in the TOC, you should get the same visibility after closing and reopening the legend.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Same thing for the legend expansion. There is a property IsExpanded which should not be lost.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you retemplate the legend control? How does your template look?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 16:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710782#M18250</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-03-25T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Legend Control stop to refresh</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710783#M18251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again! You are right, I don't have this problem when I'm testing our app. with version 2.2 beta.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any idea when we may get version 2.2? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alexander.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 17:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-stop-to-refresh/m-p/710783#M18251</guid>
      <dc:creator>AlexanderKhoroshun</dc:creator>
      <dc:date>2011-03-25T17:07:22Z</dc:date>
    </item>
  </channel>
</rss>

