public Task<bool> ExpandExtentAsync(double dx, double dy)
{
return QueuedTask.Run(() =>
{
//Get the active map view.
var mapView = MapView.Active;
if (mapView == null)
returnfalse;
//Expand the current extent by the given ratio.
var extent = mapView.Extent;
var newExtent = ArcGIS.Core.Geometry.GeometryEngine.Instance.Expand(extent, dx, dy, true);
return mapView.ZoomTo(newExtent);
});
}