private void StopCamera() { if (_device != null) { _device.Dispose(); _device = null; } }
private async System.Threading.Tasks.Task StartCamera() { if (_device == null) { _device = new BarcodeCaptureDevice(); _device.AutoFocus = true; _device.AutoDetectBarcode = true; await _device.InitAsync(); previewTransform.Rotation = _device._device.SensorRotationInDegrees; barcodeUITransform.Rotation = _device._device.SensorRotationInDegrees; _device.BindVideoBrush(previewVideo); _device.BarcodeDetected += BarcodeDetected; } }