/// <summary>
 /// delete current expense
 /// </summary>
 void DeleteExpense()
 {
     expenseViewModel.DeleteExpenseAsync(Assignment, CurrentExpense).ContinueWith(_ => {
         activity.RunOnUiThread(() => {
             var fragment = activity.FragmentManager.FindFragmentById <ExpenseFragment> (Resource.Id.contentFrame);
             fragment.ReloadExpenseData();
             Dismiss();
         });
     });
 }
        public void DeleteExpense()
        {
            var assignment = new Assignment();
            var loadTask   = viewModel.LoadExpensesAsync(assignment);

            loadTask.Wait();

            var task = viewModel.DeleteExpenseAsync(assignment, viewModel.Expenses.First());

            task.Wait();

            Assert.That(assignment.TotalExpenses, Is.EqualTo(0m));
        }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     expenseViewModel
     .DeleteExpenseAsync(assignmentViewModel.SelectedAssignment, expenseViewModel.Expenses[indexPath.Row])
     .ContinueWith(_ => BeginInvokeOnMainThread(controller.ReloadExpenses));
 }