public async Task Scanned(Windows.Devices.PointOfService.BarcodeScannerDataReceivedEventArgs args) { try { VibrationDevice testVibrationDevice = VibrationDevice.GetDefault(); testVibrationDevice.Vibrate(TimeSpan.FromTicks(500000)); string scannedCode = await GetData(args.Report.ScanDataLabel, args.Report.ScanDataType); string scannedSymbology = Windows.Devices.PointOfService.BarcodeSymbologies.GetName(args.Report.ScanDataType); MessagingCenter.Send <xx.App, string>((xx.App)obj.xxApp, "scannedValue", scannedCode + "###" + scannedSymbology); } catch (Exception ex) { MessagingCenter.Send <xx.App, string>((xx.App)obj.xxApp, "exception", "ScrannerInit/Scanned: " + ex.Message); } }
public async Task Scanned(Windows.Devices.PointOfService.BarcodeScannerDataReceivedEventArgs args) { try { //var scannedValue = null; string scannedCode = await GetData(args.Report.ScanDataLabel, args.Report.ScanDataType); string scannedSymbology = Windows.Devices.PointOfService.BarcodeSymbologies.GetName(args.Report.ScanDataType); //Debug.WriteLine(scannedCode + "\r\n" + scannedSymbology); //await DisplayAlert("Skänn", scannedCode + "\r\n" + scannedSymbology, "OK"); //await Received(scannedCode, scannedSymbology, mp); //if (!obj.isDeviceHandheld) //{ // mp.Focus(FocusState.Programmatic); //} } catch (Exception ex) { //await DisplayAlert("Error", "Scanned failed, Code:" + " Message:" + ex.Message, "OK"); } }
public async void ClaimedScanner_DataReceivedAsync(Windows.Devices.PointOfService.ClaimedBarcodeScanner sender, Windows.Devices.PointOfService.BarcodeScannerDataReceivedEventArgs args) { try { await Scanned(args); } catch (Exception ex) { MessagingCenter.Send <xx.App, string>((xx.App)obj.xxApp, "exception", "ScrannerInit/ClaimedScanner_DataReceivedAsync: " + ex.Message); } }
public async void ClaimedScanner_DataReceivedAsync(Windows.Devices.PointOfService.ClaimedBarcodeScanner sender, Windows.Devices.PointOfService.BarcodeScannerDataReceivedEventArgs args) { try { await Scanned(args); } catch (Exception ex) { //await DisplayAlert("Error", "ClaimedScanner_DataReceivedAsync failed, Code:" + " Message:" + ex.Message, "OK"); } }