<ListBox Margin="0,5,0,0" x:Name="LayerList" Grid.Row="1"> <ListBox.ItemTemplate> <DataTemplate> <CheckBox Margin="2" Name="DynamicLayerCalifornia" Content="{Binding Name}" Tag="{Binding ID}" ClickMode="Press" Click="CheckBox_Click" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
private ObservableCollection<LayerInfo> layers = new ObservableCollection<LayerInfo>(); public MainPage() { InitializeComponent(); this.LayerList.ItemsSource = layers; } private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e) { ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer dynamicServiceLayer = sender as ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer; foreach (LayerInfo l in dynamicServiceLayer.Layers) layers.Add(l); dynamicServiceLayer.VisibleLayers = new int[] { }; }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.