private void SelectedWellsTreeView_OnSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
if (e.RemovedItems.Count > 0)
{
Graphic g = e.RemovedItems[0] as Graphic;
g.UnSelect();
g.SetZIndex(0);
}
if (e.AddedItems.Count > 0)
{
Graphic g = e.AddedItems[0] as Graphic;
g.Select();
g.SetZIndex(1);
//Relationship query
RelationshipParameter relationshipParameters = new RelationshipParameter()
{
ObjectIds = new int[] { Convert.ToInt32(g.Attributes[SelectedWellsTreeView.Tag as string]) },
OutFields = new string[] { "OBJECTID, API_NUMBER, ELEVATION, FORMATION, TOP" },
RelationshipId = 3,
OutSpatialReference = MyMap.SpatialReference
};
queryTask.ExecuteRelationshipQueryAsync(relationshipParameters);
}
}