Fixed QR-Code

This commit is contained in:
TheJoKlLa 2023-01-31 15:12:22 +01:00
parent 1e2604486c
commit 530112ccc6
2 changed files with 22 additions and 6 deletions

View File

@ -2,10 +2,12 @@
using Prism.Commands; using Prism.Commands;
using Prism.Navigation; using Prism.Navigation;
using Prism.Services; using Prism.Services;
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Xamarin.Forms; using Xamarin.Forms;
using ZXing; using ZXing;
using ZXing.Mobile;
namespace Borepin.PageModel namespace Borepin.PageModel
{ {
@ -40,6 +42,23 @@ namespace Borepin.PageModel
#endregion #endregion
#region Fields #region Fields
public MobileBarcodeScanningOptions ScanOptions
{
get
{
return new MobileBarcodeScanningOptions()
{
PossibleFormats = new List<BarcodeFormat>()
{
BarcodeFormat.QR_CODE,
BarcodeFormat.EAN_13,
},
AutoRotate = true,
DelayBetweenContinuousScans = 300,
};
}
}
private Result _ScanResult; private Result _ScanResult;
public Result ScanResult public Result ScanResult
{ {
@ -73,7 +92,6 @@ namespace Borepin.PageModel
public void ScannedCommandExecute() public void ScannedCommandExecute()
{ {
IsScanning = false; IsScanning = false;
IsVisible = false;
INavigationParameters parameters = new NavigationParameters() INavigationParameters parameters = new NavigationParameters()
{ {
@ -96,7 +114,6 @@ namespace Borepin.PageModel
public async Task CancelCommandExecute() public async Task CancelCommandExecute()
{ {
IsScanning = false; IsScanning = false;
IsVisible = false;
INavigationParameters parameters = new NavigationParameters() INavigationParameters parameters = new NavigationParameters()
{ {

View File

@ -34,14 +34,14 @@ namespace Borepin.PageModel
return new MobileBarcodeScanningOptions() return new MobileBarcodeScanningOptions()
{ {
PossibleFormats = new List<BarcodeFormat>() PossibleFormats = new List<BarcodeFormat>()
{ {
BarcodeFormat.QR_CODE, BarcodeFormat.QR_CODE,
BarcodeFormat.EAN_13, BarcodeFormat.EAN_13,
// TODO add more Barcode Formats if needed
}, },
AutoRotate = true,
DelayBetweenContinuousScans = 300,
}; };
} }
//set => SetProperty(ref _ScanOptions, value);
} }
private Result _ScanResult; private Result _ScanResult;
@ -146,7 +146,6 @@ namespace Borepin.PageModel
public async Task CancelCommandExecute() public async Task CancelCommandExecute()
{ {
IsScanning = false; IsScanning = false;
IsVisible = false;
await _NavigationService.GoBackAsync().ConfigureAwait(false); await _NavigationService.GoBackAsync().ConfigureAwait(false);
} }