<?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: Example of Legend with Templates in a Style in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361055#M9302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, never mind, I now see this isn't expected to work for single fused cache layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/31873-Unusual-Legend-Behavior-for-Grouping?p=118901&amp;amp;viewfull=1#post118901"&gt;http://forums.arcgis.com/threads/31873-Unusual-Legend-Behavior-for-Grouping?p=118901&amp;amp;viewfull=1#post118901&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like Esri should choose a different mapservice for this demo app, instead of this one ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/WaterDistributionNetwork/MapServer"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/WaterDistributionNetwork/MapServer&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Sep 2011 20:33:16 GMT</pubDate>
    <dc:creator>KirkKuykendall</dc:creator>
    <dc:date>2011-09-15T20:33:16Z</dc:date>
    <item>
      <title>Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361049#M9296</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'm using the Legend from this sample:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LegendWithTemplates"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LegendWithTemplates&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And would like to put the templates into a style.&amp;nbsp; Is there a sample somewhere that shows how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 21:09:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361049#M9296</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2011-09-06T21:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361050#M9297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can put the legend templates in a style by code like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
&amp;lt;Style x:Key="legendStyleName" TargetType="esri:Legend"&amp;gt;
&amp;nbsp; &amp;lt;Setter Property="LayerItemsMode" Value="Tree" /&amp;gt;
&amp;nbsp; &amp;lt;Setter Property="MapLayerTemplate"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Setter.Value&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataTemplate&amp;gt;...........
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a lot of style samples here : &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=c673bf3e983b418495eeb0f45bb44c68" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.arcgis.com/home/item.html?id=c673bf3e983b418495eeb0f45bb44c68&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:49:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361050#M9297</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T16:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361051#M9298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, this helps a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm also wanting to style the appearance of the little triangles used to expand/collapse group layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Notice how the black background on this sample makes it impossible to see the black triangles next to group layers that are expanded.&amp;nbsp; After the background to orange, I can see them (see attached).&amp;nbsp; How could I just change the color for the triangle when it's in an expanded state?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2011 15:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361051#M9298</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2011-09-15T15:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361052#M9299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt;How could I just change the color for the triangle when it's in an expanded state? &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The legend control is based on a treeview that you can customize.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To change the expander button, you have to change the TreeViewItem style.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The easiest way is with BLEND:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Right-Click your Legend control&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]. Edit Template&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;. Edit a Copy...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]- Right Click the TreeViewExtended of the created template&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]. Edit Additional Templates&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;. ItemContainerStyle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;. Edit a Copy...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]- Right Click the Expander button (toogle button)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]. Edit Template&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;. Edit Current&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]- Change the UncheckedVisual and CheckedVisual element as you want&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By googling you might also find sample of expander button. Example : &lt;/SPAN&gt;&lt;A href="http://stackoverflow.com/questions/3444375/custom-expand-collapse-symbols-in-silverlight-treeview-using-hierarchicaldatatemp"&gt;http://stackoverflow.com/questions/3444375/custom-expand-collapse-symbols-in-silverlight-treeview-using-hierarchicaldatatemp&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2011 17:04:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361052#M9299</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-09-15T17:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361053#M9300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahh, thanks, I should have known better than try to deal visually with this code in Visual Studio.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure if this is a bug, but if I run the original demo app without any changes, and go to the TOC template, I'm unable to toggle on and off different sub layers (like Hydrants).&amp;nbsp; See attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this an error in the style somewhere?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://forums.arcgis.com/attachment.php?attachmentid=9009&amp;amp;stc=1&amp;amp;d=1316118571" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2011 19:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361053#M9300</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2011-09-15T19:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361054#M9301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think this is a bug in the setter for LayerItemViewModel.IsEnabled, I changed the demo code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!--&amp;lt;CheckBox IsChecked="{Binding IsEnabled, Mode=TwoWay}" IsEnabled="{Binding IsInScaleRange}" VerticalAlignment="Center"/&amp;gt;--&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;!--&amp;lt;TextBlock Text="{Binding Label}" VerticalAlignment="Center"&amp;nbsp; /&amp;gt;--&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;Button VerticalAlignment="Center"&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding Label}" /&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;i:Interaction.Triggers&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;i:EventTrigger EventName="Click" &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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;local:ShowLayerInfoAction/&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/i:EventTrigger&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/i:Interaction.Triggers&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;/Button&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And in the ShowLayerInfoAction, debug always prints true before and after:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;protected override void Invoke(object parameter)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; try
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var livm = this.AssociatedObject.DataContext as LayerItemViewModel;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var dynLayer = livm.Layer as ArcGISDynamicMapServiceLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("IsEnable before " + livm.IsEnabled.ToString());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; livm.IsEnabled = !livm.IsEnabled;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine("IsEnable after " + livm.IsEnabled.ToString());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //string url = String.Format("{0}/{1}",dynLayer.Url,livm.SubLayerID);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //HtmlPage.Window.Navigate(new Uri(url), "_blank");
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.WriteLine(ex.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:49:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361054#M9301</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2021-12-11T16:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361055#M9302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, never mind, I now see this isn't expected to work for single fused cache layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/31873-Unusual-Legend-Behavior-for-Grouping?p=118901&amp;amp;viewfull=1#post118901"&gt;http://forums.arcgis.com/threads/31873-Unusual-Legend-Behavior-for-Grouping?p=118901&amp;amp;viewfull=1#post118901&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like Esri should choose a different mapservice for this demo app, instead of this one ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/WaterDistributionNetwork/MapServer"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/WaterDistributionNetwork/MapServer&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2011 20:33:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361055#M9302</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2011-09-15T20:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Example of Legend with Templates in a Style</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361056#M9303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt;OK, never mind, I now see this isn't expected to work for single fused cache layers.&lt;BR /&gt; &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Right. From AGS version 10, the map services have been optimized to use the cache when this one exists. The counterpart is that it's no more possible to change the sublayer visibilities or set the layer definitions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; &lt;BR /&gt;Seems like Esri should choose a different mapservice for this demo app, instead of this one ...&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Right. You'll try to change that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When the demo has been created, the server was in 9.3.1 and it was possible to change the sublayer visibilities. But the server has been updated meanwhile.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2011 06:04:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/example-of-legend-with-templates-in-a-style/m-p/361056#M9303</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-09-16T06:04:47Z</dc:date>
    </item>
  </channel>
</rss>

