private void GeometryService_RelationCompleted(object sender, RelationEventArgs args)
{
List<GeometryRelationPair> results = args.Results;
foreach (GeometryRelationPair pair in results)
{
if (pointLayer.Graphics[pair.Graphic1Index].Attributes["Relation"] == null)
{
pointLayer.Graphics[pair.Graphic1Index].Attributes["Relation"] =
string.Format("Within Polygon {0}", pair.Graphic2Index);
}
else
{
pointLayer.Graphics[pair.Graphic1Index].Attributes["Relation"] +=
"," + pair.Graphic2Index.ToString();
}
if (polygonLayer.Graphics[pair.Graphic2Index].Attributes["Relation"] == null)
{
polygonLayer.Graphics[pair.Graphic2Index].Attributes["Relation"] =
string.Format("Contains Point {0}", pair.Graphic1Index);
}
else
{
polygonLayer.Graphics[pair.Graphic2Index].Attributes["Relation"] +=
"," + pair.Graphic1Index.ToString();
}
}
ExecuteRelationButton.Visibility = Visibility.Visible;
}