Select to view content in your preferred language

Bind checkbox to visible layers on map

5128
11
Jump to solution
04-20-2011 05:07 AM
by Anonymous User
Not applicable
Original User: Toosters

Hi

Can someone please tell me how to bind checkbox is checked to visible layers on map (not defaultvisibility on mapservice, IsChecked="{Binding DefaultVisibility}" ).

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).

Thankful for suggestions or examples
0 Kudos
11 Replies
DominiqueBroux
Esri Frequent Contributor
Finally implementing a new view model class is not that complex and is a much cleaner approach.

I did it in the sublayerlist sample by adding a combox allowing the user to select the Layer whose the sublayers will be displayed.

Attached is the code and a screen shot
0 Kudos
by Anonymous User
Not applicable
Original User: Toosters

Yes this works!! 🙂

Thank you very much Dominique!!
0 Kudos