private void TakePicture()
        {
            PhotoResult photoResult = fotoapparat.TakePicture();

            photoResult.SaveToFile(new File(GetExternalFilesDir("photos"), "photo.jpg"));
            photoResult
            .ToBitmap()
            .WhenDone(new WhenDoneListener(r =>
            {
                if (r == null)
                {
                    return;
                }
                BitmapPhoto bitmapPhoto = r.JavaCast <BitmapPhoto>();
                onImageCaptured?.Invoke(this, new ImageCapturedEventArgs {
                    ProfilePic = bitmapPhoto.Bitmap, RotationDegrees = bitmapPhoto.RotationDegrees
                });
                Finish();
            }));
        }