Select to view content in your preferred language

slider inside legenda

584
2
01-26-2011 06:14 AM
MarcoRosa
Emerging Contributor
Hi , hi have this case:
a arcgisdynamicmapservicelayer whitin of them just 1 layer. I observed that if
LayerItemsMode = flat the slider of opacity doesn't more visible instead if LayerItemsMode is Tree is visible.
Is there a way to view the slider in both case ? or workaround about this ?

thank's very much
GP


the code is the following:

          <esri:Legend x:Name="legenda" Map="{Binding ElementName=Map}" 
                         LayerItemsMode="Flat"
                         ShowOnlyVisibleLayers="False"
                         Refreshed="Legend_Refreshed">
               
                <esri:Legend.MapLayerTemplate>
                    <DataTemplate>
                          <StackPanel Orientation="Horizontal">

                            <Grid x:Name="BusyIndicator" Background="Transparent" Margin="3,0"
       HorizontalAlignment="Left" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" >
                                <Grid.Triggers>
                                    <EventTrigger RoutedEvent="Grid.Loaded">
                                        <EventTrigger.Actions>
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0:0:1" RepeatBehavior="Forever" To="360" Storyboard.TargetName="BusyIndicator"
                     Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" />
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger.Actions>
                                    </EventTrigger>
                                </Grid.Triggers>

                                <Grid.RenderTransform>
                                    <RotateTransform />
                                </Grid.RenderTransform>
                                <Ellipse Fill="#1E525252" Margin="11,2,11,20" Width="2" Height="2"/>
                                <Ellipse Fill="#3F525252" Height="3" Width="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,4,5,0" />
                                <Ellipse Fill="#7F525252" Width="4" HorizontalAlignment="Right" Height="4" VerticalAlignment="Top" Margin="0,9,1,0" />
                                <Ellipse Fill="#BF525252" Height="5" Width="5" VerticalAlignment="Bottom" Margin="0,0,3,3" HorizontalAlignment="Right" />
                                <Ellipse Fill="#FF525252" Height="6" Width="6" VerticalAlignment="Bottom" Margin="9,0" />
                            </Grid>
                            <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 x:Name="CheckBoxLayers" Content="{Binding Label}"
                   IsChecked="{Binding IsEnabled, Mode=TwoWay}"
                IsEnabled="{Binding IsInScaleRange}" Checked="CheckBox_Checked"
                            Unchecked="CheckBox_Unchecked">
                        </CheckBox>
                    </DataTemplate>
                </esri:Legend.LayerTemplate>
               
            </esri:Legend>
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
You can add the same slider to the layerTemplate:

 
<esri:Legend.LayerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="CheckBoxLayers" Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" Checked="CheckBox_Checked"
Unchecked="CheckBox_Unchecked">
</CheckBox>
<Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
</StackPanel>
</DataTemplate>
</esri:Legend.LayerTemplate>



This is obsiously not modifying the opacity of the sublayer (that's not possible) but of the main service layer. But as you have only one sublayer in your service, the result is the same.
0 Kudos
MarcoRosa
Emerging Contributor
it's perfect thank u
byeee
0 Kudos