table of content (legend), I want to check and uncheck sublayers independently

839
1
08-28-2012 10:21 AM
Labels (1)
FrancoisGilbert
New Contributor
Hello,

I am new to ArcGis Runtime and XAML. I am building a wpf user control in visual studio 2010 to display a map. I have been able to use an example to display the table of content of a map with a slider and checkbox for the layer group using the XAML template defined below.


            <DataTemplate x:Key="My_MapLayerTemplate">
                <StackPanel Orientation="Horizontal">
                    <CheckBox Content="{Binding Label}" IsChecked="{Binding IsEnabled, Mode=TwoWay}"/>
                    <Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
                </StackPanel>
            </DataTemplate>

This example works and display a slider and a check box for all layer. I would like to have them for all sublayers independently. Is this possible.
0 Kudos
1 Reply
FrancoisGilbert
New Contributor
I found the answer by myself

I needed to set the "Legend1.LayerTemplate" property instead of the the "Legend1.MapLayerTemplate". Now each individual layer have a check box.
0 Kudos