Ejemplo n.º 1
0
        public void Delete(Entry entry)
        {
            this.IsLoading = true;

            App.Azure.GetTable<Entry>().DeleteAsync(entry).ContinueWith((t) =>
            {
                var ex = t.Exception;

                this.IsLoading = false;

                if (t.Status == System.Threading.Tasks.TaskStatus.RanToCompletion)
                {
                    entries.Remove(entry);
                    RaisePropertyChanged("Entries");
                }
            });
        }
Ejemplo n.º 2
0
 public void Select(Entry entry)
 {
     RequestNavigate<EntryViewModel>(new {listId = WishList.Id, entryId = entry.Id});
 }
Ejemplo n.º 3
0
        public void Delete(Entry entry)
        {
            IsLoading = true;

            var entryId = entry.Id;

            App.Azure.GetTable<Entry>().DeleteAsync(entry).ContinueWith(t =>
                {
                    var ex = t.Exception;

                    IsLoading = false;

                    this.InvokeOnMainThread(() =>
                        {
                            if (t.Status == TaskStatus.RanToCompletion)
                            {
                                if (_entries == null)
                                    return;

                                _entries.Remove(entry);
                                RaisePropertyChanged("Entries");
                            }
                        });
                });
        }
Ejemplo n.º 4
0
        public void LoadEntry()
        {
            IsLoading = true;

            App.Azure.GetTable<Entry>().LookupAsync(EntryId).ContinueWith(t =>
                {
                    var ex = t.Exception;

                    if (t.Status == TaskStatus.RanToCompletion)
                    {
                        _entry = t.Result;
                        RaisePropertyChanged(() => Entry);

                        if (!string.IsNullOrEmpty(_entry.ImageGuid))
                        {
                            App.Azure.GetTable<EntryImage>()
                               .Where(ei => ei.ImageGuid == _entry.ImageGuid)
                               .ToListAsync()
                               .ContinueWith(t2 =>
                                   {
                                       var ex2 = t2.Exception;

                                       if (t2.Status == TaskStatus.RanToCompletion && t2.Result.Count > 0)
                                       {
                                           _entryImage = t2.Result[0];
                                           RaisePropertyChanged(() => EntryImage);
                                           RaisePropertyChanged(() => HasImage);
                                       }

                                       IsLoading = false;
                                   });
                        }
                        else
                            IsLoading = false;
                    }
                    else
                    {
                        IsLoading = false;
                        ReportError("Could not load Item!");
                    }
                });
        }