protected async override void DeleteSelected() { if ( MessageBox.Show("Are you sure you want to delete this Infection?", "Agrimanagr: Delete Infection", MessageBoxButton.YesNo) == MessageBoxResult.No) return; using (var c = NestedContainer) { var response = new ResponseBool() { Success = false }; if (SelectedInfection == null) return; _proxy = Using<IDistributorServiceProxy>(c); response = await _proxy.InfectionDeleteAsync(SelectedInfection.Id); if (response.Success) { var infection = Using<IInfectionRepository>(c).GetById(SelectedInfection.Id); Using<IInfectionRepository>(c).SetAsDeleted(infection); MessageBox.Show(response.ErrorInfo, "Agrimangr:Manage Infection", MessageBoxButton.OK, MessageBoxImage.Information); } } }