.This is the class that saved the queried features.
public class IdedFeatures
{
public string LayerName { get; set; }
public IDictionary<string, Object> AttrData { get; set; }
public string DisplayString { get; set; }
public Graphic idedGraphic { get; set; }
}
Below should be your query completed event.
if (e.IdentifyResults != null && e.IdentifyResults.Count > 0)
{
//List that will hold the all identified features as an instance our custom class "IdedFeatures"
m_ListIdedFeatures = new List<IdedFeatures>();
//loop thru each identified feature,create instance of the class "IdedFeatures", set its properties
//using IdentifiedFeature and add this instance to its list.
foreach (IdentifyResult idResult in e.IdentifyResults)
{
IdedFeatures idedFeat = new IdedFeatures();
idedFeat.LayerName = idResult.LayerName;
idedFeat.AttrData = idResult.Feature.Attributes;
idedFeat.idedGraphic = idResult.Feature;
idedFeat.DisplayString = idResult.LayerName + " : " + idResult.Value;
m_ListIdedFeatures.Add(idedFeat);
}
//set datasource of combo box
cmbIdentifyResult.ItemsSource = null;
cmbIdentifyResult.ItemsSource = m_ListIdedFeatures;
}
Below is the selection changed event of my Combo. Your's would be for the ListBox.
//cast selected combo box item to the type of IdedFeatures so that we can have reference to the Graphic of the selected item.
IdedFeatures selectedFeature = cmbIdentifyResult.SelectedItem as IdedFeatures;
//zoom to the extent of the extent of the selected item in the listbox
MapControl.Extent = selectedFeature.idedGraphic.Geometry.Extent;
Let me know if this helps you.Thanks.