Parameters
- mapMember
- A layer or standalone table.
- oid
- The objectID of the feature or row to delete.
var deleteFeatures = new EditOperation() { Name = "Delete Features" }; var table = MapView.Active.Map.StandaloneTables[0]; //Delete a row in a standalone table deleteFeatures.Delete(table, oid); //Delete all the selected features in the active view //Select using a polygon (for example) //at 2.x - var selection = MapView.Active.SelectFeatures(polygon).Select( // k => new KeyValuePair<MapMember, List<long>>(k.Key as MapMember, k.Value)); //deleteFeatures.Delete(selection); var selection = MapView.Active.SelectFeatures(polygon); deleteFeatures.Delete(selection); //Execute to execute the operation //Must be called within QueuedTask.Run if (!deleteFeatures.IsEmpty) { var result = deleteFeatures.Execute(); //Execute and ExecuteAsync will return true if the operation was successful and false if not } //or use async flavor //await deleteFeatures.ExecuteAsync();
Target Platforms: Windows 11, Windows 10