private async void OnItemClick(object sender, ItemClickEventArgs e)
        {
            DonateItemViewModel selectedItem = e.ClickedItem as DonateItemViewModel;

            if (selectedItem == null)
            {
                return;
            }

            string status = await _donate.BuyItem(selectedItem);

            if (!String.IsNullOrEmpty(status))
            {
                await DialogService.GetPurchaseStatusDialog(status).ShowAsync();
            }
        }
Exemplo n.º 2
0
        public static IEnumerable <DonateItemViewModel> GetItems()
        {
            DonateItemViewModel item = new DonateItemViewModel
            {
                Title   = "Not bad!",
                Price   = "1$",
                StoreId = "piggy_one"
            };

            yield return(item);

            item = new DonateItemViewModel
            {
                Title   = "Good!",
                Price   = "2$",
                StoreId = "piggy_two"
            };

            yield return(item);

            item = new DonateItemViewModel
            {
                Title   = "Very good!",
                Price   = "3$",
                StoreId = "piggy_three"
            };

            yield return(item);

            item = new DonateItemViewModel
            {
                Title   = "Excellently!",
                Price   = "4$",
                StoreId = "piggy_four"
            };

            yield return(item);

            item = new DonateItemViewModel
            {
                Title   = "OMG!",
                Price   = "5$",
                StoreId = "piggy_five"
            };

            yield return(item);
        }