diff --git a/Borepin/Borepin/PageModel/ScanPageModel.cs b/Borepin/Borepin/PageModel/ScanPageModel.cs index 5a6498c..e8ae0ef 100644 --- a/Borepin/Borepin/PageModel/ScanPageModel.cs +++ b/Borepin/Borepin/PageModel/ScanPageModel.cs @@ -2,10 +2,12 @@ using Prism.Commands; using Prism.Navigation; using Prism.Services; +using System.Collections.Generic; using System.Threading.Tasks; using System.Windows.Input; using Xamarin.Forms; using ZXing; +using ZXing.Mobile; namespace Borepin.PageModel { @@ -40,6 +42,23 @@ namespace Borepin.PageModel #endregion #region Fields + public MobileBarcodeScanningOptions ScanOptions + { + get + { + return new MobileBarcodeScanningOptions() + { + PossibleFormats = new List() + { + BarcodeFormat.QR_CODE, + BarcodeFormat.EAN_13, + }, + AutoRotate = true, + DelayBetweenContinuousScans = 300, + }; + } + } + private Result _ScanResult; public Result ScanResult { @@ -73,7 +92,6 @@ namespace Borepin.PageModel public void ScannedCommandExecute() { IsScanning = false; - IsVisible = false; INavigationParameters parameters = new NavigationParameters() { @@ -96,7 +114,6 @@ namespace Borepin.PageModel public async Task CancelCommandExecute() { IsScanning = false; - IsVisible = false; INavigationParameters parameters = new NavigationParameters() { diff --git a/Borepin/Borepin/PageModel/ScanURNPageModel.cs b/Borepin/Borepin/PageModel/ScanURNPageModel.cs index e047c23..6185eaf 100644 --- a/Borepin/Borepin/PageModel/ScanURNPageModel.cs +++ b/Borepin/Borepin/PageModel/ScanURNPageModel.cs @@ -34,14 +34,14 @@ namespace Borepin.PageModel return new MobileBarcodeScanningOptions() { PossibleFormats = new List() - { + { BarcodeFormat.QR_CODE, BarcodeFormat.EAN_13, - // TODO add more Barcode Formats if needed }, + AutoRotate = true, + DelayBetweenContinuousScans = 300, }; } - //set => SetProperty(ref _ScanOptions, value); } private Result _ScanResult; @@ -146,7 +146,6 @@ namespace Borepin.PageModel public async Task CancelCommandExecute() { IsScanning = false; - IsVisible = false; await _NavigationService.GoBackAsync().ConfigureAwait(false); }