internal Task DeleteCost(CostViewModel cost) { return(Task.Factory.StartNew(() => { App.RunUIAsync(() => { Costs.Remove(cost); }); DbWorker.RemoveCost(cost.Model); })); }
/// <summary> /// Adds the selected costs to the current costs /// </summary> private void OnCostInclude() { IEnumerable <SessionCostSelectionViewModel> costs = GetSelectedCosts(); foreach (SessionCostSelectionViewModel costVM in costs) { ChoosenCosts.AddNewItem(costVM); Costs.Remove(costVM); costVM.IsSelected = false; } ChoosenCosts.CommitNew(); CostsModified(); IsDataModified = true; }