Default Visibility Settings

506
2
02-24-2011 09:31 AM
adamestrada
New Contributor
If @billdollins were sitting here next to me I would get a slap in the head but I have to ask anyway...There is an example in the samples gallery (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SubLayerList) that displays the sublayer list of a particular service. I don't want mine to display by default like this one does but rather allow the user to check which layers they would like to see interactively. I am new to silverlight and this xaml makes no sense to me. Can anyone suggest how to disable each layer being viewed/visible when the page loads.

<ListBox Margin="0,5,0,0" ItemsSource="{Binding ElementName=MyMap, Path=Layers.[DynamicLayerCalifornia].Layers}" 
                         Grid.Row="1">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <CheckBox Margin="2"
                                  Name="DynamicLayerCalifornia"
                                  Content="{Binding Name}" 
                                  IsChecked="{Binding DefaultVisibility}" 
                                  Tag="{Binding ID}"
                                  ClickMode="Press" 
                                  Click="CheckBox_Click" />
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>


Thanks,
Adam
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
Actually, you are not the first to ask this question 🙂 This is related thread http://forums.arcgis.com/threads/11385-sublayer-List-display?highlight=visiblelayers+dynamic
0 Kudos
adamestrada
New Contributor
Thanks Jennifer! Clear as mud, huh... 😉

Adam
0 Kudos