private async void GrayScale() { if (_bitmapClone != null) { var bitmap = _lockbitmapFactory.CreateLockBitmap(_bitmapClone); bitmap.LockBits(); await Task.WhenAll(_imageProcessing.AdjustImage(bitmap, new None <object>(), _grayscaleFunction)); bitmap.UnlockBits(); ImageSource = _bitmapClone.ToBitmapSource(); } }