im trying to work out if you can access an object that was added to a list (of objects) something like this:
public class nearshop_data
{
public String r_name { get; set; }
public String r_desc { get; set; }
public String loc_lat { get; set; }
public String loc_lon { get; set; }
}
then adding to that list as you would
shop_data = new nearshop_data();
lo = new List<object>();
for (int i = 0; i < count; i++) {
shop_data.r_name = stuff.results[i].name;
shop_data.r_desc = stuff.results[i].vicinity;
shop_data.loc_lat = stuff.results[i].geometry.location.lat;
shop_data.loc_lon = stuff.results[i].geometry.location.lng;
lo.Add(shop_data);
}
then i want to retrieve that in another class say in the code behind and here is where it all fails... as i cant actually access the properties of that object
any ideas on how to rewrite the code or what to use?
I'm guessing when I get the instance of that list in my code behind and lets say retrieve it at index 0 its still boxed in (or am i wrong?) - i vaguely remember something like this was done in java