async void UnlockComponent(object sender, EventArgs e) { var Button = (CachedImage)sender; var id = Convert.ToInt32(Button.ClassId); var item = App.database.GetItemFromID(id).First(); int tokenNumber = item.Price; AvatarPopup ap = new AvatarPopup(); ap.UpdatePreview(Button, tokenNumber, this, id, item.ImagePath); await PopupNavigation.Instance.PushAsync(ap); /*bool answer = await DisplayAlert("", "Vill du låsa upp "+ item.Descriptions+" för " + tokenNumber + " mynt?", "Nej", "Ja"); * if (!answer) * { * * if (App.LoggedinUser.Plustokens >= tokenNumber) * { * * * * } else * { * await DisplayAlert("", "Inte tillräckligt mynt. Du har bara " + App.LoggedinUser.Plustokens + ". Du behöver " + (tokenNumber - App.LoggedinUser.Plustokens) + " mynt till.", "Okej."); * } * }*/ }
async void UnlockComponent(object sender, EventArgs e) { var Button = (CachedImage)sender; var id = Convert.ToInt32(Button.ClassId); var item = App.database.GetItemFromID(id).First(); int tokenNumber = item.Price; AvatarPopup ap = new AvatarPopup(); ap.UpdatePreview(Button, tokenNumber, this, id, item.ImagePath); await PopupNavigation.Instance.PushAsync(ap); }