How to assign identify output to an info window

710
1
05-09-2013 12:07 PM
DonFreeman
New Contributor
I have an infowindow defined with a datatemplate. I want to perform an identify task and display the result in the infowindow. My code works to popup the infowindow but it comes up empty. How do I make the assignment to get the data into the infowindow? Also, in the definition of the identify task, is there a way to specify the single layer we want the results to come from?

Thanks

Here is my current code.
private void IdentifyTask_ExecuteCompleted(object sender, IdentifyEventArgs args)
  {
   if (args.IdentifyResults != null && args.IdentifyResults.Count > 0)
   {
   // MessageBox.Show(args.IdentifyResults.Count.ToString());

    MyInfoWindow.Anchor = clickPoint;

    MyInfoWindow.IsOpen = true;
    MyInfoWindow.Content = args.IdentifyResults;
   }
   else
   {
    MyInfoWindow.IsOpen = false;
   }
  }
0 Kudos
1 Reply
GirishYadav
Occasional Contributor
Hi,
args.IdentifyResults is a collection of IdentifyResult. It would be better if you iterate through this collection and  pass IdentifyResult.Feature.Attributes to infoWindow. You need to adjust infoWindow's data template accordingly.

Thanks,
Girish
0 Kudos