Busy indicator in legends control

700
4
02-10-2011 08:44 AM
MarcoRosa
New Contributor
Hi to al,
i have a legends that work fine , but i try to add a empty featurelayer from code behind

FeatureLayer f = new FeatureLayer()
f.ID = "test"
.......
Map.Layers.Add(f)

, the layer it's added correctly but busy indicator never stop to rotate.

why this happens ?

thank u as usual to all

GP
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
I can't reproduce this behavior.

Is there something specific in your use case that could help to figure out the issue?
0 Kudos
MarcoRosa
New Contributor
Hi dominique,
if u use lagend code below : i suppose that each service has only 1 layer and the legenda has a slider for change the opacity of this layer.
In this case the feature layer is displayer correctly on map but busy indicator never stop
Canu take a look at my code ?

thanks very much

Giorgio


       <esri:Map x:Name="MyMap" Extent="-597504.918146718,3083906.30060328,4062425.28871863,6379297.98623311">
           <esri:ArcGISTiledMapServiceLayer ID="StreetMap"                     Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
           
            <esri:FeatureLayer ID="Regioni_Feat"
                    Url="http://myserver/ArcGIS/rest/services/Regioni/MapServer/0" />


        </esri:Map>

        <Border Background="#77919191" BorderThickness="1" CornerRadius="5"
            HorizontalAlignment="Right"  VerticalAlignment="Top"
            Margin="20" Padding="5" BorderBrush="Black" >


            <esri:Legend x:Name="legenda" Map="{Binding ElementName=MyMap}" 
                         LayerItemsMode="Flat"
                         ShowOnlyVisibleLayers="False"
                         LayerIDs="Regioni_Feat">

                <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>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox x:Name="CheckBoxLayers" 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.LayerTemplate>
            </esri:Legend>

</Border>
0 Kudos
DominiqueBroux
Esri Frequent Contributor
In your MapLayerTemplate the busy indicator is always visible.
You have to add a binding to the BusyIndicatorVisibility:

 
<Grid x:Name="BusyIndicator" Background="Transparent" Margin="3,0" Visibility="{Binding BusyIndicatorVisibility}" ....
 
0 Kudos
MarcoRosa
New Contributor
it's true .... tank u very much
ciao
0 Kudos