Hi guys, I use a listbox to display sublayers and the Itemtemplate of the listbox is checkbox. I want to implement such function that when some actions, like selection or query task, are done, a few layers are set visible and at the same time the checkboxes are checked. Sorry about my confused description....I mean these checkboxes are not checked by clicking, instead they will be checked by codes.
<Border x:Name="AdministrativeTabBorder" Margin="5,0,5,0" Visibility="Collapsed" Grid.Column="0" Grid.Row="4" BorderBrush="#FFFFFFCC">
<ListBox x:Name="AdministrativeListBox" FontSize="12" Background="#FFFFFFCC" BorderBrush="#FFFFFFCC">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Margin="2" FontSize="9"
Name="AdministrativeCheckBox"
Content="{Binding Name}"
IsChecked="{Binding DefaultVisibility, Mode=TwoWay}"
Tag="{Binding ID}"
ClickMode="Press"
Click="AdministrativeCheckBox_Click"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
Here are the actions that layer 20 and 21 are set visible. I want to add some codes here to make checkboxes checked. Any ideas or thoughts? Thank you! 🙂
dynamicServiceLayer.SetLayerVisibility(21, true);
dynamicServiceLayer.SetLayerVisibility(20, true);