用DrawObject画框,并选中框框内的图元:
//fLayer为FeatureLayer
double x1, y1, x2, y2;
mapControl.MapToScreen(rc.XMin, rc.YMin, out x1, out y1);
mapControl.MapToScreen(rc.XMax, rc.YMax, out x2, out y2);
//需要将屏幕坐标点转到Application.Current.RootVisual对应的坐标点
var trans = mapControl.TransformToVisual(Application.Current.RootVisual);
//注意:pt1为最小坐标,pt2为最大坐标
var pt1 = trans.Transform(new Point(Math.Min(x1, x2), Math.Min(y1, y2)));
var pt2 = trans.Transform(new Point(Math.Max(x1, x2), Math.Max(y1, y2)));
var ftrs = fLayer.FindGraphicsInHostCoordinates(new Rect(pt1, pt2));
foreach (var ftr in ftrs)
ftr.Select();