private void selectTool_Click(object sender, RoutedEventArgs e) { if (MapEditor.Select.CanExecute("Keyboard")) { MapEditor.SelectionMode = DrawMode.Rectangle; //MapEditor.Select.Execute("Keyboard"); } } private void unselectTool_Click(object sender, RoutedEventArgs e) { if (MapEditor.ClearSelection.CanExecute(null)) { MapEditor.ClearSelection.Execute(null); //MapEditor.SelectionMode = DrawMode.None; } if (MapEditor.CancelActive.CanExecute(null)) { MapEditor.CancelActive.Execute(null); } }
<ToolBarTray Margin="0,0,0,267" DataContext="{StaticResource MyEditor}"> <ToolBar> <Button Content="SelectTool" Foreground="Black" CommandParameter="Add" Command="{Binding Select}" /> <Button Content="UnSelectTool" Foreground="Black" CommandParameter="Remove" Command="{Binding Select}" /> </ToolBar> </ToolBarTray>
Hi,
You could use try using Button Command and CommandParameter properties. Once the selection has been removed you can not select again until you click the SelectTool button. This is also demonstrated in the Selecting a FeatureLayer sample.
http://resources.arcgis.com/en/help/runtime-wpf/samples/index.html#/Selecting_a_FeatureLayer/02q2000...
Cheers,
Kerrie
I am running into this problem today. I select in the table and then select using the tool on the map and it unselects my feature.