Riccardo Daria

Riccardo Daria

  • 1.3k
  • 74
  • 5.1k

Read Barcode by XING

May 23 2023 4:19 PM

i use this code:

public partial class PageScanner : ContentPage
{
    
    public PageScanner()
    {
       
        InitializeComponent();

        zxing.OnScanResult += (result) => Device.BeginInvokeOnMainThread(() => {
            lblResult.Text = result.Text;

            // Emetti un suono

            zxing.IsScanning = false; // Chiudi la videocamera
                                      // await  Navigation.PushAsync(new Page1());
                                      //  zxing.IsVisible = false;
        });
    }

    protected override void OnAppearing()
    {
        base.OnAppearing();
        zxing.IsScanning = true;
    }
    protected override void OnDisappearing()
    {
        zxing.IsScanning = false;
        base.OnDisappearing();
    }
}

it works good.

i need to open the scanner/camera by clicking a button on this page and not on Appearing as it works now

Can Anyone help ME?

THANKS


Answers (1)