<?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 expanding till layers symbology level + arcgis api for silverlight in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273772#M7143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks dbroux&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jun 2013 08:47:47 GMT</pubDate>
    <dc:creator>PhanindraKuchipudi</dc:creator>
    <dc:date>2013-06-14T08:47:47Z</dc:date>
    <item>
      <title>Legend control expanding till layers symbology level + arcgis api for silverlight 3.0</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273770#M7141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Legend control with tree mode when expanding showing layer symbology also. My map service has combination of feature layers, group layers and raster layers. When I click on the Map service layer in legend with tree mode to see the layers available, it is expanding each and every layer item till its symbology level and making legend control lengthy. I don't want layer items to expand till their symbology level. I am using arcgis api for silverlight 3.0 interactive sample code for legend control with tree mode in my project. Can any one help me to get my job done?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 05:10:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273770#M7141</guid>
      <dc:creator>PhanindraKuchipudi</dc:creator>
      <dc:date>2013-06-04T05:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Legend control expanding till layers symbology level + arcgis api for silverlight</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273771#M7142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;By default the legend tree nodes are expanded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can change this behavior either by restyling the legend control, or, likely easier, by code on the event Legend.Refreshed:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Collapse all map layers in the legend.
&amp;nbsp;&amp;nbsp;&amp;nbsp; e.LayerItem.IsExpanded = false;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Collapse all sublayers
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.LayerItem.LayerItems != null)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var sublayerItem in e.LayerItem.LayerItems)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sublayerItem.IsExpanded = false;
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273771#M7142</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T13:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Legend control expanding till layers symbology level + arcgis api for silverlight</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273772#M7143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks dbroux&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 08:47:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273772#M7143</guid>
      <dc:creator>PhanindraKuchipudi</dc:creator>
      <dc:date>2013-06-14T08:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Legend control expanding till layers symbology level + arcgis api for silverlight</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273773#M7144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; By default the legend tree nodes are expanded.&amp;nbsp; &lt;BR /&gt;You can change this behavior either by restyling the legend control, or, likely easier, by code on the event Legend.Refreshed:&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Collapse all map layers in the legend.
&amp;nbsp;&amp;nbsp;&amp;nbsp; e.LayerItem.IsExpanded = false;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Collapse all sublayers
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.LayerItem.LayerItems != null)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var sublayerItem in e.LayerItem.LayerItems)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sublayerItem.IsExpanded = false;
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This worked for me when I wanted to collapse all layers and sublayers:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#008000&amp;quot;;"&gt;private void Legend_Refreshed(object sender, ESRI.ArcGIS.Client.Toolkit.Legend.RefreshedEventArgs e)&lt;BR /&gt; {&lt;BR /&gt; // The purpose of the code in this function is to cause all of the leaves in the Legend to be collapsed&lt;BR /&gt; // to the highest level (i.e. the Layer level) when the application starts up. It is by setting the &lt;BR /&gt; // LayerItemViewModel.IsExpandable = False for each Layer/sub-Layer that allows this behavior to occur.&lt;BR /&gt; // Had this code-behind logic not been used all of the leaves would have been expanded to their lowest level &lt;BR /&gt; // in the Legend Control (this is the default behavior).&lt;BR /&gt;&lt;BR /&gt; // Get the Legend.&lt;BR /&gt; ESRI.ArcGIS.Client.Toolkit.Legend theLegend = (ESRI.ArcGIS.Client.Toolkit.Legend)sender;&lt;BR /&gt;&lt;BR /&gt; // Get the LayerItems of the Legend Control.&lt;BR /&gt; System.Collections.ObjectModel.ObservableCollection&amp;lt;ESRI.ArcGIS.Client.Toolkit.Primitives.LayerItemViewModel&amp;gt; theObservableCollection = theLegend.LayerItems;&lt;BR /&gt;&lt;BR /&gt; // Loop through the ObservableCollection&amp;lt;LayerItemViewModel&amp;gt; objects for each Layer. &lt;BR /&gt; foreach (ESRI.ArcGIS.Client.Toolkit.Primitives.LayerItemViewModel theLayerItemViewModel in theObservableCollection)&lt;BR /&gt; {&lt;BR /&gt; // Close the leaves in the Legend Control for the Layers&lt;BR /&gt; theLayerItemViewModel.IsExpanded = false;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; //close the leaves in the Legend Control for the sub layers&lt;BR /&gt; &lt;BR /&gt; if (e.LayerItem.LayerItems != null)&lt;BR /&gt; foreach (var sublayerItem in e.LayerItem.LayerItems)&lt;BR /&gt; sublayerItem.IsExpanded = false;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/legend-control-expanding-till-layers-symbology/m-p/273773#M7144</guid>
      <dc:creator>BrandonIves</dc:creator>
      <dc:date>2021-12-11T13:22:04Z</dc:date>
    </item>
  </channel>
</rss>

