private void Map_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (!displayAttribute || editor == null || !editor.GraphicsLayers.Any(l => l is FeatureLayer))
return;
if (e.Gesture != GestureType.Tap)
return;
var featureLayers = from l in editor.GraphicsLayers
where l is FeatureLayer
select l as FeatureLayer;
var graphics = e.DirectlyOver(TAP_TOLERANCE, featureLayers);
if (graphics != null && graphics.GetEnumerator().MoveNext())
{
var graphic = graphics.First();
FeatureLayer layer = null;
if (graphic == null) return;
foreach (var l in featureLayers)
{
if (l.Graphics == null)
return;
if (l.Graphics.Contains(graphic))
{
layer = l;
break;
}
}
if (layer != null)
{
e.Handled = true;
TemplatePicker.ShowAttributeForm(layer, graphic);
this.displayAttribute = this.Continuous;
}
}
}