コード例 #1
0
        internal Task DeleteCost(CostViewModel cost)
        {
            return(Task.Factory.StartNew(() =>
            {
                App.RunUIAsync(() =>
                {
                    Costs.Remove(cost);
                });

                DbWorker.RemoveCost(cost.Model);
            }));
        }
コード例 #2
0
        /// <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;
        }