<?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: Bind checkbox to visible layers on map in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18300#M473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vipulsoni&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thx for your answer&lt;BR /&gt;&lt;BR /&gt;But I mean layers in a mapservice, like in this example: SubLayerList. &lt;BR /&gt;&lt;BR /&gt;The binding to mapservice's visible layers (on map!) should be binded in code behind. The layers' visibility on map works but the checkbox need to be in sync with that, and that is not the case. &lt;BR /&gt;&lt;BR /&gt;When I close the sublayer list and open it again and initialize the mapservice again, then the defaultvisibility is binded to the checkbox IsChecked, and that is not the truth, because more layers are visible than the default.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess what you are asking is answered in the following forum post and also the source code is given in the zip to download.. I have used the same zip code and it works too..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/9141-Get-Layer-Legends-for-Rest-service"&gt;http://forums.arcgis.com/threads/9141-Get-Layer-Legends-for-Rest-service&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Apr 2011 06:30:25 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2011-04-21T06:30:25Z</dc:date>
    <item>
      <title>Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18296#M469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Toosters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone please tell me how to bind checkbox is checked to visible layers on map (not defaultvisibility on mapservice, IsChecked="{Binding DefaultVisibility}" ). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using sublayer list example (interactive samples, 9.3 arcgisserver). I have got the listbox binded in code to chosen mapservice layer: listbox.ItemsSource = layerInfoArray. I have also got all, on map, visible layers(from selected mapservice) in a list: layer.VisibleLayers.ToList(). I want to bind theese layerids from visiblelayerlist to checkbox so that if i close sublayerlist and opens again checkbox.ischecked should then be binded to the layers that actual are visible on map(visibleLayers list). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thankful for suggestions or examples&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 12:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18296#M469</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-20T12:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18297#M470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jenniferdnery&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can look at this SDK sample: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LayerList" rel="nofollow"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LayerList&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note the following, IsChecked is bound to map layer Visible property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;ListBox x:Name="MyList" ItemsSource="{Binding ElementName=MyMap, Path=&lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;Layers&lt;/SPAN&gt;&lt;SPAN&gt;}"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;!--more code goes here--&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;CheckBox IsChecked="{Binding &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;Visible&lt;/SPAN&gt;&lt;SPAN&gt;, Mode=TwoWay}" /&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 02:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18297#M470</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-21T02:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18298#M471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Toosters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx for your answer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I mean layers in a mapservice, like in this example: SubLayerList. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The binding to mapservice's visible layers (on map!) should be binded in code behind. The layers' visibility on map works but the checkbox need to be in sync with that, and that is not the case. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I close the sublayer list and open it again and initialize the mapservice again, then the defaultvisibility is binded to the checkbox IsChecked, and that is not the truth, because more layers are visible than the default.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 04:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18298#M471</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-21T04:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18299#M472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I have got the listbox binded in code to chosen mapservice layer: listbox.ItemsSource = layerInfoArray.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could maintain your own binding collection in code if you really wanted but there is no need for that because the legend control binding to the map control takes care of everything.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 06:20:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18299#M472</guid>
      <dc:creator>SteveVidal</dc:creator>
      <dc:date>2011-04-21T06:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18300#M473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vipulsoni&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thx for your answer&lt;BR /&gt;&lt;BR /&gt;But I mean layers in a mapservice, like in this example: SubLayerList. &lt;BR /&gt;&lt;BR /&gt;The binding to mapservice's visible layers (on map!) should be binded in code behind. The layers' visibility on map works but the checkbox need to be in sync with that, and that is not the case. &lt;BR /&gt;&lt;BR /&gt;When I close the sublayer list and open it again and initialize the mapservice again, then the defaultvisibility is binded to the checkbox IsChecked, and that is not the truth, because more layers are visible than the default.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess what you are asking is answered in the following forum post and also the source code is given in the zip to download.. I have used the same zip code and it works too..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/9141-Get-Layer-Legends-for-Rest-service"&gt;http://forums.arcgis.com/threads/9141-Get-Layer-Legends-for-Rest-service&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 06:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18300#M473</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-21T06:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18301#M474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Toosters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using ArcGIS 9.3.1 REST API 1.2 and the legend control is only available in arcgis 10?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So how could I get the dynamic layer's VisibleLayers binding to their checkboxes in code when the layer is being Initialized. The legend is unnecessary at this point.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 08:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18301#M474</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-21T08:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18302#M475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm using ArcGIS 9.3.1 REST API 1.2 and the legend control is only available in arcgis 10?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The legend control is available from SL API version 2.1 but can work with ArcGIS 9.3.1 if your service is public (arcgis.com fallback mechanism).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So how could I get the dynamic layer's VisibleLayers binding to their checkboxes in code when the layer is being Initialized. The legend is unnecessary at this point. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks very close of what is doing this sample : &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SubLayerList"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SubLayerList&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the issue with this sample?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 12:54:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18302#M475</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-04-26T12:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18303#M476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Toosters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanx for the response&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a combobox where the user can select mapservices and the sublayerlist is then being loaded. The user can then check and uncheck layers from checkboxes and everything works fine. The problem is when user select another mapservice from the combobox and then again return to the first. The sublayer list loads and "defaultvisibility" determines which checkboxes are checked although other layers are visible on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I would like to bind checkbox to visiblelayers. Thats the difference from the sample.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 06:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18303#M476</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-27T06:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18304#M477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK I got it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can't easily use a binding (except by creating your own view model class). I suggest you initialize the checkboxes by code when the user selects a map service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Note : using the legend control, which is done for that, would be simpler &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; (and more generic since the sublayerlist sample is not taking care of the group layers).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 08:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18304#M477</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-04-27T08:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18305#M478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Toosters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We will soon update to arcgis 10 but until that I have to use another solution &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a little problem with the initialization of the checkboxes. When selecting mapservice I get the visible layers but how do I proceed from that and get the checkboxes checked if they are in the visiblelist? Could you please help me with the iniatilize of the checkboxes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanx again&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 12:03:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18305#M478</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-27T12:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18306#M479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Finally implementing a new view model class is not that complex and is a much cleaner approach.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did it in the sublayerlist sample by adding a combox allowing the user to select the Layer whose the sublayers will be displayed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the code and a screen shot&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 11:40:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18306#M479</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-04-28T11:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Bind checkbox to visible layers on map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18307#M480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Toosters&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes this works!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much Dominique!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2011 07:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/bind-checkbox-to-visible-layers-on-map/m-p/18307#M480</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-04-29T07:01:35Z</dc:date>
    </item>
  </channel>
</rss>

