private void DeleteAccount() { MessageBoxResult result = MessageBox.Show("Are You Sure?", "Account Deletion", MessageBoxButton.OKCancel); if (result != MessageBoxResult.OK) return; CapitalServiceClient client = new CapitalServiceClient(); try { IsBusy = true; client.DeleteAccountCompleted += (s, e) => { if (e.Error == null) { EditAccount = null; UpdateViews(); } else if (e.Error is FaultException<CapitalError>) { ErrorMessages.FaultError(e.Error.Message); } else { ErrorMessages.UnexpectedError(); } IsBusy = false; }; client.DeleteAccountAsync(EditAccount); } catch { client.Abort(); } finally { client.CloseAsync(); } }