Files
Jugenddienst-Stunden/Jugenddienst Stunden/Views/AboutPage.xaml.cs
2024-08-20 12:28:28 +02:00

28 lines
651 B
C#

using ZXing;
using ZXing.Net.Maui.Controls;
namespace Jugenddienst_Stunden.Views;
public partial class AboutPage : ContentPage
{
public AboutPage()
{
InitializeComponent();
barcodeScannerView.Options = new ZXing.Net.Maui.BarcodeReaderOptions {
Formats = ZXing.Net.Maui.BarcodeFormat.QrCode,
AutoRotate = true,
Multiple = false
};
}
private void BarcodesDetected(object sender, ZXing.Net.Maui.BarcodeDetectionEventArgs e) {
var first = e.Results?.FirstOrDefault();
if (first is null) {
return;
}
Dispatcher.DispatchAsync(async () => {
await DisplayAlert("Scan-Ergebnis", $"Barcode: {first.Value}", "OK");
});
}
}