Ejemplo n.º 1
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Donations.Clear();
                Image   = String.Empty;
                Content = String.Empty;
                DonationTitles.Clear();
                var items = await DonationStore.GetItemsAsync("api/donations", true);

                if (items != null && items.Count() > 0)
                {
                    foreach (var item in items)
                    {
                        Donations.Add(item);
                        DonationTitles.Add(item.Title);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }