示例#1
0
        //~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;
        }
示例#2
0
        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);
            }
        }