await QueuedTask.Run(() =>
{
// Create a full raster from the raster dataset.
ArcGIS.Core.Data.Raster.Raster raster = rasterDataset.CreateFullRaster();
// Calculate size of pixel block to create. Use 128 or height/width of the raster, whichever is smaller.
var height = raster.GetHeight();
var width = raster.GetWidth();
int pixelBlockHeight = height > 128 ? 128 : height;
int pixelBlockWidth = width > 128 ? 128 : width;
// Create a new (blank) pixel block.
PixelBlock currentPixelBlock = raster.CreatePixelBlock(pixelBlockWidth, pixelBlockHeight);
// Read pixel values from the raster dataset into the pixel block starting from the given top left corner.
raster.Read(0, 0, currentPixelBlock);
// Do something with the pixel block...
// Write the pixel block to the raster dataset starting from the given top left corner.
raster.Write(0, 0, currentPixelBlock);
});