Souta Norogami
Souta Norogami

Reputation: 3

Why zxing scanner read qr code several times?

I just want to open new page on QR code reading, but the command starts up twice.

How can I fix it?

The command:

scanCommand = new RelayCommand(obj =>
                  {
                      _ = navigation.PushAsync(new TestPage1());
                  });

The scanner:

<zxing:ZXingScannerView 
       ScanResultCommand="{Binding ScanCommand}"
       IsScanning="{Binding IsScanning}"
       WidthRequest="300" HeightRequest="300"
       VerticalOptions="CenterAndExpand"
       HorizontalOptions="CenterAndExpand"/>
    <zxing:ZXingDefaultOverlay BottomText="Align the code inside the frame"/>

Upvotes: 0

Views: 644

Answers (1)

Wendy Zang - MSFT
Wendy Zang - MSFT

Reputation: 10978

As i know, Zxing scanner will be scanning all the time.

You could set the IsScanning property to false in your command to provent.

scanCommand = new RelayCommand(obj =>
    {
        IsScanning=false;
        _ = navigation.PushAsync(new TestPage1());
    });

Upvotes: 0

Related Questions