//~BaseViewModel() //{ // _scannerService.OnBarcodeScanned -= _scannerService_OnBarcodeScanned; //} void _scannerService_OnBarcodeScanned(object sender, Services.Models.OnBarcodeScannedEventArgs e) { var scannedBarcode = e?.BarCodes?.FirstOrDefault(); if (scannedBarcode == null) { return; } var searchCode = scannedBarcode.Barcode; var symbology = scannedBarcode.Symbology; ScannedBarcodeText = searchCode; }
void _scannerService_OnBarcodeScanned(object sender, Services.Models.OnBarcodeScannedEventArgs e) { var scanneBarcode = e?.BarCodes?.FirstOrDefault(); if (scanneBarcode == null) { ScannedBacodeText = "Invalid bar code"; return; } var barCodeScanned = scanneBarcode.BarCode; var symbology = scanneBarcode.Symbology; ScannedBacodeText = barCodeScanned; if (!string.IsNullOrEmpty(ScannedBacodeText) && ScannedBacodeText != "From Main View Model") { ScannedBacodeText = ReverseString(ScannedBacodeText); } }