Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

HowTo: ZXing.Net.Mobile with PRISM

$
0
0

Hy,

i want to integrate Barcode Scanning inn my App using Prism.
<br /> private async void Scan()<br /> {<br /> var options = new MobileBarcodeScanningOptions<br /> {<br /> AutoRotate = true,<br /> UseFrontCameraIfAvailable = false,<br /> TryHarder = true,<br /> PossibleFormats = new List&lt;ZXing.BarcodeFormat> { ZXing.BarcodeFormat.CODE_128 }<br /> };</p> <pre><code>var scanPage = new ZXingScannerPage(options) { DefaultOverlayTopText = "Align the barcode within the frame", DefaultOverlayBottomText = string.Empty, DefaultOverlayShowFlashButton = true }; await Navigation.PushAsync((scanPage); scanPage.OnScanResult += (result) => { // Stop scanning scanPage.IsScanning = false; // Pop the page and show the result Device.BeginInvokeOnMainThread(async () => { await NavigationService.GoBackAsync(); await _dialogService.DisplayAlertAsync("Barcode Scanned", result.Text, "OK"); }); };

}

My problem is the line
<br /> await Navigation.PushAsync((scanPage);<br />
I do not have access to Navigation on PRISM and the PRISM NavigationService wont take a page as parameter.

Has anyone solved this issue?

Thank you


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>