I am using a local tiled layer as basemap and want its sublayers to appear in layer visibility control.This is the code I am using to bind Layers of Basemap.
<TreeView Grid.Row="1" ItemsSource="{Binding ElementName=MyMap, Path=Layers}" Margin="20">
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="TreeViewItem.IsExpanded" Value="True" />
<Setter Property="Focusable" Value="False" />
</Style>
</TreeView.ItemContainerStyle>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildLayers}">
<Grid Width="150">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Text="{Binding DisplayName}" FontSize="16" Margin="0,8,0,0"/>
<CheckBox Grid.Row="1" Grid.Column="0" IsChecked="{Binding IsVisible, Mode=TwoWay}" />
<Slider Grid.Row="1" Grid.Column="1" Value="{Binding Opacity, Mode=TwoWay}"
TickFrequency="0.01" Minimum="0" Maximum="1" />
</Grid>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
But it binds the Basemap as a single layer. I want to show its sub layers in Tree view.So that I can show all layers used in Basemap in treeview list.