bugthesystem / FireSharp

An asynchronous cross-platform .Net library for Firebase
The Unlicense
697 stars 147 forks source link

Get item key from list #99

Closed roberzyx closed 7 years ago

roberzyx commented 7 years ago

Hi, I'm trying to get the data from an array in the database and binding it to a ListBox using a custom class. I do it like this and I have no trouble doing it: image The problem comes when detecting a selection change in the ListBox, I don't know what item are they clicking at. It would be necessary to add to my class the key each one of the items retrieved by the response.

Any idea about how could I achieve this? Thanks for awesome your work!

arcosmin commented 7 years ago

You should deserialize your data into a dictionary rather than a list where the key is the object id. Firebase stores key-value pairs so you should work with the data in the same way in your code.

arcosmin commented 7 years ago

Assume fixed