private async void captureButton_Click(object sender, RoutedEventArgs e) { if (cameraCapture != null) { file = await cameraCapture.CapturePhoto(); IRandomAccessStream imageStream = (await file.OpenStreamForReadAsync()).AsRandomAccessStream(); BitmapImage image = new BitmapImage(); image.SetSource(imageStream); previewField.Source = image; await cameraCapture.StopPreview(); captureField.Source = null; cameraCapture.Dispose(); } }