disabling a checkboxlevel in legend only for image symbology

Discussion created by aafgilbert01 on Nov 15, 2013
Latest reply on Nov 22, 2013 by dbroux-esristaff

Whenever I display my legend for the weather forecast, I have tree view of checkbox in my legend. The user never have to touch the last level, the one just before the display of the color symbology. I would like to disable the check box of that last level without hardcoding my application. Here is the definition of my LayerTemplate.

<Setter Property="LayerTemplate">
                            <StackPanel Orientation="Horizontal" Margin="0,4,0,0" >
                                    <StackPanel MaxWidth="400">
                                        <!--<TextBlock FontWeight="Bold" Text="{Binding Layer.ID}" TextWrapping="Wrap" />-->
                                        <TextBlock FontWeight="Bold"   Text="{Binding Label}" TextWrapping="Wrap" />
                                        <!--<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
                                        <TextBlock Text="{Binding SubLayerID, StringFormat='SubLayer ID : {0}'}" />
                                        <TextBlock Text="{Binding MinimumResolution, StringFormat='Minimum Resolution : {0:F6}'}" />
                                        <TextBlock Text="{Binding MaximumResolution, StringFormat='Maximum Resolution : {0:F6}'}" />-->

                                    <!--IsEnabled="{Binding IsInScaleRange}"-->
                                    <CheckBox Tag="{Binding Layer.ID}"  IsEnabled="{Binding IsInScaleRange}" Content="{Binding Label}"  IsChecked="{Binding IsEnabled, Mode=TwoWay}" VerticalAlignment="Center" Unchecked="Layer_CheckedOrUnchecked" Checked="Layer_CheckedOrUnchecked"/>
                                    <!--<CheckBox Content="{Binding Label}" IsChecked="{Binding IsEnabled}"
                                              IsEnabled="{Binding IsVisible}" IsHitTestVisible="False" VerticalAlignment="Center" />-->