protected void ImageRead(PipeRequest request, Pipe pipe) { if (Active) { _imageRequest = null; try { if (request.Result.IsNative) { LoadedImage = ImageUtility.BitmapImageFromBytes(request.Result.AsByteArray); } else { using (Stream stream = request.Result.OpenStream()) LoadedImage = ImageUtility.BitmapImageFromStream(stream); } } catch { LoadedImage = ImageUtility.GetErrorImage(); } } }