Forum Libraries, Components, and Plugins

ZXing : Exception on PopModalAsync under UWP

Hello,

The app I'm developping requires the usage of two scanners in different tabs, so I went to use ZXingScannerView's in each of them. The scanners work fine, but I'm having an exception when I "PopModalAsync" the global page (to return to login one), and this WON'T occur on iOS : it only occurs on UWP !

Could someone try to explain me why this happens ? I've been trying stuff for weeks but couldn't even trick-fix this... I've just noticed that if you have ONLY ONE scanner and "PopModalAsync" while IsScanning is true, there is no exception, but you can't have two scanners "IsScanning" at a time with the same camera so this won't work for me.

Thanks for help !

Posts

  • leeyoleeyo USMember ✭✭

    If it matters (don't think so), this is how code looks like (2x) :

    View (XAML - Binds bound to a ViewModel class) :

    <zxing:ZXingScannerView x:Name="Scanner" IsVisible="{Binding ScanVisibility}" IsScanning="{Binding ScanScanning}" IsAnalyzing="{Binding ScanAnalyzing}" />

    Note that both scanners are never scanning at the same time, else it would crash the app.

    Behind :

    Scanner.OnScanResult += (result) => Device.BeginInvokeOnMainThread(() => { // Using result.Text etc. } );

Sign In or Register to comment.