I'm trying to add a map tip to a feature layer. The service that the layer is bound to returns a collection of sites, and one of the properties that the service brings back is the primary key, called Site_ID. In the map tip, I want to display the name of the site, but the service doesn't return it, just Site_ID.I don't really have access to the service, so I can't just modify it to return the site name.My page contains a dictionary of side IDs/site names, so I'd like to write a converter at the page level that takes the Site_ID of the site as a parameter, and returns the site name.I wrote this converter on the page...
public class SiteNameConverter : IValueConverter
{
// assume this dictionary is populated with site_id's, site_names.
private Dictionary<String, String> siteDictionary = new Dictionary<string, string>();
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return siteDictionary[value.ToString()];
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException("This method will not be called for one-way binding");
}
}
Now I just need to figure out how to pass it the Site_ID, to get back the site name. Any ideas?Thanks!