AnsweredAssumed Answered

Interactive Legend check-box bindings

Question asked by afcon on Mar 20, 2014
Latest reply on Mar 25, 2014 by dbroux-esristaff
Hi,

I have an interactive legend with check-box for each layer (like in samples)

[HTML]<esri:Legend Map="{Binding ElementName=MyMap}" 
                         LayerIDs="USA"
                         LayerItemsMode="Tree"
                         ShowOnlyVisibleLayers="False"
                         Refreshed="Legend_Refreshed">
                <esri:Legend.MapLayerTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox Content="{Binding Label}"
                                    IsChecked="{Binding IsEnabled, Mode=TwoWay}"
                                    IsEnabled="{Binding IsInScaleRange}" >
                            </CheckBox>
                            <Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
                        </StackPanel>
                    </DataTemplate>
                </esri:Legend.MapLayerTemplate>
                <esri:Legend.LayerTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding Label}"
                            IsChecked="{Binding IsEnabled, Mode=TwoWay}"
                            IsEnabled="{Binding IsInScaleRange}" >
                        </CheckBox>
                    </DataTemplate>
                </esri:Legend.LayerTemplate>
            </esri:Legend>[/HTML]

I have an arcGISDynamicMapService which i took one of its childLayer and made it invisible. also added it as FeatureLayer to my
map. The legend is showing me both the hidden layer and the featureLayer - i want to change bindings of this specific layer only
in order to influence only the feature layer visibility and keep the original layer hidden. (But keep the regular bindings to the other
layers)
Note: i have removed the featureLayer from legend - i want the user see it in the original service hierarchy.

Any ideas?

Outcomes