Legend problem

482
2
Jump to solution
06-07-2012 12:51 PM
LuisGarcia2
Occasional Contributor II
I am trying the example for the legend shown HERE It does display the check boxes the way shown in the example. However, when I deselect any of the boxes the layer not only disappears from the map as intended but also goes away in the legend control...
Is there any setting I need to change? Here is the XAML conde I'm using:

<esri:Legend Name="legend1" Map="{Binding ElementName=map1}" LayerItemsMode="Tree">                 <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>


If you notice, it is exactly the same thing as in the example...
0 Kudos
1 Solution

Accepted Solutions
DaveTimmins
Occasional Contributor II
Hi,

it sound slike you have ShowOnlyVisibleLayers ( http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.Toolkit~ESRI.ArcGIS.Client.To... ) set to true. Try making it false.

Cheers

View solution in original post

0 Kudos
2 Replies
DaveTimmins
Occasional Contributor II
Hi,

it sound slike you have ShowOnlyVisibleLayers ( http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.Toolkit~ESRI.ArcGIS.Client.To... ) set to true. Try making it false.

Cheers

View solution in original post

0 Kudos
LuisGarcia2
Occasional Contributor II
Thanks! That was it!

Thanks again!
0 Kudos