Пример #1
0
        void HandleTimeBlockUpdated(object sender, EntityEventArgs <TimeBlock> e)
        {
            ITimeBlockListItemViewModel item = Items.FirstOrDefault(i => i.Id == e.Entity.Id);

            if (item != null)
            {
                TimeBlock timeBlock = timeBlocksModel.Get(e.Entity.Id);
                item.Update(timeBlock);
            }
        }
Пример #2
0
        void ExecuteDeleteTimeBlock()
        {
            // are you sure?
            Guid idToDelete = SelectedItem.Id;

            timeBlocksModel.Delete(idToDelete);
            ITimeBlockListItemViewModel item = Items.FirstOrDefault(i => i.Id == idToDelete);

            if (item != null)
            {
                Items.Remove(item);
            }
        }