<?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 How can I make the Legend tree nodes collapse by default? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399504#M10390</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 am using ESRI's Legend with template for my TOC, but by default, the most levels of the tree nodes are expended. Is there a easy way that I can collapse these nodes at the initialization phase?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also in the Legend, in one of our dynamic map service, we want to change the map service URL to another service if the user click a button.&amp;nbsp; The legend refreshes automatically, however, the on/off check boxes are kind been changed from the initial service settings (e.g., some check boxes, which should be unchecked by default, are checked, and vice versa). Is there a way that I can fix it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wei&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Aug 2011 19:13:03 GMT</pubDate>
    <dc:creator>weiliang</dc:creator>
    <dc:date>2011-08-08T19:13:03Z</dc:date>
    <item>
      <title>How can I make the Legend tree nodes collapse by default?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399504#M10390</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 am using ESRI's Legend with template for my TOC, but by default, the most levels of the tree nodes are expended. Is there a easy way that I can collapse these nodes at the initialization phase?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also in the Legend, in one of our dynamic map service, we want to change the map service URL to another service if the user click a button.&amp;nbsp; The legend refreshes automatically, however, the on/off check boxes are kind been changed from the initial service settings (e.g., some check boxes, which should be unchecked by default, are checked, and vice versa). Is there a way that I can fix it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wei&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 19:13:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399504#M10390</guid>
      <dc:creator>weiliang</dc:creator>
      <dc:date>2011-08-08T19:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Legend tree nodes collapse by default?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399505#M10391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can somebody help me out? Especially for the service URL changing issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wei&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 19:12:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399505#M10391</guid>
      <dc:creator>weiliang</dc:creator>
      <dc:date>2011-08-15T19:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Legend tree nodes collapse by default?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399506#M10392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code below is in the legend's Refreshed event and should collapse all nodes under each layer.&amp;nbsp; Not sure on the check boxes - maybe rebind the the map property of the legend?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void mapLegend_Refreshed(object sender, Legend.RefreshedEventArgs e)
&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; CollapseLayerItems(e.LayerItem);
&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; private void CollapseLayerItems(LayerItemViewModel livm)
&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; //collapses a node in the legend tree and all of its sub layers recursively
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; livm.IsExpanded = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (livm.LayerItems != null)
&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; foreach (LayerItemViewModel sublayerItemVM in livm.LayerItems)
&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; CollapseLayerItems(sublayerItemVM);
&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; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399506#M10392</guid>
      <dc:creator>TerryGiles</dc:creator>
      <dc:date>2021-12-11T18:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make the Legend tree nodes collapse by default?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399507#M10393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Many thanks, Terry. I will try to see if it works for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wei&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 14:34:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-can-i-make-the-legend-tree-nodes-collapse-by/m-p/399507#M10393</guid>
      <dc:creator>weiliang</dc:creator>
      <dc:date>2011-08-16T14:34:18Z</dc:date>
    </item>
  </channel>
</rss>

