Esempio n. 1
0
 public void RevertEvent()
 {
     if (DetailItem.IsNew)
     {
         DetailItem = null;
     }
     else
     {
         DetailItem.LoadDataModel();
     }
 }
Esempio n. 2
0
        public async Task DeleteEvent()
        {
            var detail = DetailItem;

            if (detail == null)
            {
                throw new InvalidOperationException();
            }

            var selectedItem = SelectedItem;
            await detail.Delete();

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

            SelectedItem = null;
            DetailItem   = null;
        }
Esempio n. 3
0
        async void UpdateDetails()
        {
            if (selectedItem == null)
            {
                DetailItem = null;
            }
            else if (DetailItem == null || DetailItem.Model.Id != selectedItem.Id)
            {
                IsLoading = true;
                try
                {
                    var item = await LoadDetails(selectedItem.Id);

                    DetailItem = new EventDetailViewModel(item);
                }
                catch
                {
                }
                finally
                {
                    IsLoading = false;
                }
            }
        }
Esempio n. 4
0
 public void NewEvent()
 {
     SelectedItem = null;
     DetailItem   = new EventDetailViewModel(new Event(), true);
 }