When i delete a feature, I always ask our users if they are sure before I progress to delete or rollback in the OnRowDeleteEvent of my module.
//PROCEED with the delete
args.CancelEdit(() => Task.FromResult(true));
//CANCEL the Delete
args.CancelEdit(() => Task.FromResult(false));
But now it seems that the progressor comes up after my message box has already been shown. My code is waiting for the result of the message box, so this "Deleting Selected Features" must be popping up on some type of out of the box code. Is there a way to suppress this Progressor or maybe I need to take another approach now?
//My code waits for user response, but out of box progressor covers this up now
MessageBoxResult mbr = ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Are you sure you want to Delete this Feature?", "Confirm Delete",
I was able to make this work in the new version now. I think this is much cleaner now. This allows you to get user input and act on it should the user select yes or no. And it eliminates the progress dialog that was bothering me. This below just checks for user trying to delete multiple items, but you could also put logic to do something after the user says they want to delete (I sometimes have to delete other objects if a parent polygon is deleted). This would all happen in the task.
But here is my simple stop on multiple feature delete attempt.
protected async static void OnRowDeleteEvent(RowChangedEventArgs args)
// get the currently selected features in the map
int selectedCount = await FeatureServiceManagement.GetMapSelectionCount();
int selectedFeatureCount = await
if (selectedCount > 1 || selectedFeatureCount > 1)
//CANCEL the Delete
args.CancelEdit(() => DeleteMultipleError());
// other logic
public static Task<bool> DeleteMultipleError()
return QueuedTask.Run(() =>
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("You cannot delete multiple items at the same time", "Multiple Items Selected", MessageBoxButton.OK, MessageBoxImage.Stop);