I have a map with many layers and I am using a databound legend with the checkbox, code as follows.
<esri:Legend x:Name="BaseMapLegend" Map="{Binding ElementName=MyMap}"
Loaded="BaseMapLegend_Loaded" HorizontalContentAlignment="Left"
HorizontalAlignment="Left" ShowOnlyVisibleLayers="False" LayerItemsMode="Tree" Refreshed="BaseMapLegend_Refreshed" Width="auto">
<esri:Legend.MapLayerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="chkBaseMapLegend" Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}">
</CheckBox>
<Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="40" />
</StackPanel>
</DataTemplate>
</esri:Legend.MapLayerTemplate>
</esri:Legend>
I would like the legend to load with the checkboxes unchecked and the layers not appearing on the map. The default for the databound legend is that the layers load checked and all layers appear on the map via "IsChecked="{Binding IsEnabled, Mode=TwoWay}". Does anyone know how this can be done? I am working in VB in Visual Studio 2010 with ArcGIS 10 and Silverlight 4.0.
Thanks in advance for any help anyone can provide!