AnsweredAssumed Answered

Cannot get feature selection tools to become enabled

Question asked by ccposton on Nov 6, 2012
Latest reply on Jan 8, 2013 by ccposton
I'm loading my map package like this:

LocalMapService localMapService = new LocalMapService() {  Path = @"\\dtdev7240w7\Terminated\GIS Data\clark gis\myclark.mpk",  EnableDynamicLayers = true, }; localMapService.StartAsync(localService => {  if (localService.Error != null)   return;  ArcGISLocalDynamicMapServiceLayer layer = new ArcGISLocalDynamicMapServiceLayer(localMapService);  MyMap.Layers.Add(layer); });


This works well, I'm able to see the map. I have some buttons (incomplete xaml):


 <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch">   <Grid.Resources>    <Style x:Key="MyMapStyle" TargetType="esri:Map">     <Setter Property="IsTabStop" Value="true"/>     <Setter Property="ZoomDuration" Value="0:0:.75"/>     <Setter Property="PanDuration" Value="0:0:.75"/>     <Setter Property="Background" Value="#FFE3E3E3"/>     <Setter Property="ZoomFactor" Value="2"/>     <Setter Property="UseAcceleratedDisplay" Value="False"/>     <Setter Property="WrapAround" Value="True"/>    </Style>    <esri:Editor x:Key="MyEditor" SelectionMode="Rectangle" Map="{Binding ElementName=MyMap}"/>   </Grid.Resources>   <esri:Map x:Name="MyMap" Style="{StaticResource MyMapStyle}" Grid.ColumnSpan="2" Loaded="MyMap_Loaded">   </esri:Map>   <esri:Navigation Margin="5,0,0,5" HorizontalAlignment="Left" VerticalAlignment="Bottom" Map="{Binding ElementName=MyMap}"  />    <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Width="Auto" Height="Auto" Margin="0,10,10,0" Grid.Column="1">    <Border Style="{StaticResource CommonBorder}" Padding="5,5,5,5" Effect="{StaticResource dropShadow}">     <StackPanel DataContext="{StaticResource MyEditor}">      <Button x:Name="SelectButton" Style="{StaticResource ToolButton}"                             Content="New"                              Command="{Binding Select}"                              CommandParameter="New">      </Button>      <Button x:Name="AddSelectButton" Style="{StaticResource ToolButton}"                             Content="Add"                              Command="{Binding Select}"                              CommandParameter="Add">      </Button>      <Button x:Name="RemoveSelectButton" Style="{StaticResource ToolButton}"                             Content="Remove"                             Command="{Binding Select}"                             CommandParameter="Remove"                             >      </Button>      <Button x:Name="EnableKeyboardButton" Style="{StaticResource ToolButton}"                             Content="Keyboard"                             Command="{Binding Select}"                             CommandParameter="Keyboard"                             >      </Button>      <Button x:Name="ClearSelectionButton" Style="{StaticResource ToolButton}"                             Content="Clear"                             Command="{Binding ClearSelection}"                             >      </Button>      </StackPanel>    </Border>   </Grid>  </Grid>



The buttons are always disabled. I tried setting the layer's Mode to SelectionOnly, but I couldn't find a reference to my layer as a ArcGISLocalFeatureLayer. Instead, MyMap.Layers has an ArcGISLocalDynamicMapServiceLayer, which contains a Layers collection, but that only contains LayerInfo's. How can I set selection mode on layers loaded this way?

Thanks,
George

Outcomes