Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Picker

$
0
0

Hi all,

I am using a picker, and I have a model for a thing called challenge which contains a challengeName, id, among other data.

I fill my picker this way:
foreach (ChallengeApi challengeList in FXWell.Constants.userChallengesFull.ListChallenges) {
challengesPicker.Items.Add (challengeList.ChallengeName);}

However, I need to be able to add results to this challenges so when I select a challengeName from the picker I need to send it's ID back to the API. Is there a way to fill the picker with an objet and not with a string so that i can reference the selected item's id and send it when selected?

In other words, make the picker display the challenge's name but also know the challenge's id so when this name is selected it already knows which ID corresponds to it.

Thanks!


Viewing all articles
Browse latest Browse all 89864

Trending Articles