Change sublayer visibility

This sample demonstrates how to show or hide sublayers of a map image layer.

Change sublayer visibility

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.ChangeSublayerVisibility.ChangeSublayerVisibility"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView"/>
        <Border
            Background="White" BorderBrush="Black" BorderThickness="1"
            HorizontalAlignment="Right" VerticalAlignment="Top"
            Margin="30" Padding="20" Width="375">
            <StackPanel>
                <TextBlock Text="Change sublayer visibility" 
                      Margin="0,0,0,2" TextWrapping="Wrap" />
                <ListView x:Name="sublayerListView">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox Content="{Binding Name}" IsChecked="{Binding IsVisible}" Margin="2"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </StackPanel>
       </Border>
    </Grid>
</UserControl>


In this topic
  1. Code