private void ZoomToGraphic() { if (activeGraphic != null && activeGraphic.Geometry != null) { var graphicExtent = activeGraphic.Geometry.Extent; var mapExtent = MyMap.Extent; double mapExtentWidth = mapExtent.XMax - mapExtent.XMin; double mapExtentHeight = mapExtent.YMax - mapExtent.YMin; if (MyMap.Rotation != 0) { mapExtentHeight = mapExtent.XMax - mapExtent.XMin; mapExtentWidth = mapExtent.YMax - mapExtent.YMin; } //Just Center the map to your graphic MyMap.PanTo(graphicExtent.GetCenter()); //Zoom using factor. double xRatio = mapExtentWidth / graphicExtent.Width; double yRatio = mapExtentHeight /graphicExtent.Height; MyMap.Zoom(xRatio > yRatio ? yRatio : xRatio); } }