public Task<bool> ExpandExtentAsync(double dx, double dy) { return QueuedTask.Run(() => { //Get the active map view. var mapView = MapView.Active; if (mapView == null) return false; //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); }); }
Target Platforms: Windows 10, Windows 8.1