this code returns an empty string. What can I do to return something please?
CivicAddressResolver civicResolver = new CivicAddressResolver();
CivicAddress c = civicResolver.ResolveAddress(new GeoCoordinate(39,77));
textBlock1.Text = c.City;
this code returns an empty string. What can I do to return something please?
CivicAddressResolver civicResolver = new CivicAddressResolver();
CivicAddress c = civicResolver.ResolveAddress(new GeoCoordinate(39,77));
textBlock1.Text = c.City;
There really isn't enough information here to comment anything. We need to know what ResolveAddress does. What do you want it to return? It seems like whatever you are doing can't find the long/lat (I assume) you are sending in.
Depending on what you want to do, you should return a null CivicAddress if it can't find the CivicAddress you are looking for and then do a null check before assigning o the textBlock1 control.
The MSDN documentation for CivicAddressResolver.ResolveAddress() suggests that checking c.IsUnknown before trying to access c.City would be a good idea.
From the MSDN docs (phone specific version):
This method is not implemented in the current release.
I would think that this is why you are not getting a result on Windows Phone 7.
Hopefully this functionality will be available soon. (And preferably via an OTA update.)
If you are not doing this on the phone please retag this question appropriately.