51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using CommunityToolkit.Mvvm.Input;
|
|
using System.Windows.Input;
|
|
using Microsoft.Maui.Dispatching;
|
|
//using BarcodeScanning;
|
|
|
|
namespace Jugenddienst_Stunden.ViewModels {
|
|
internal class AboutViewModel {
|
|
public string Title => AppInfo.Name;
|
|
public string Version => AppInfo.VersionString;
|
|
public string MoreInfoUrl => "https://aka.ms/maui";
|
|
public string Message => "This app is written in XAML and C# with .NET MAUI.";
|
|
public ICommand ShowMoreInfoCommand { get; }
|
|
|
|
|
|
|
|
public AboutViewModel() {
|
|
ShowMoreInfoCommand = new AsyncRelayCommand(ShowMoreInfo);
|
|
}
|
|
|
|
async Task ShowMoreInfo() =>
|
|
await Launcher.Default.OpenAsync(MoreInfoUrl);
|
|
|
|
|
|
//private async void SetupBarcodeScanner() {
|
|
// try {
|
|
// var scanner = new BarcodeScanner();
|
|
// var result = await scanner.ScanAsync();
|
|
|
|
// if (result != null) {
|
|
// await DisplayAlert("Scan-Ergebnis", $"Barcode: {result.Barcode}", "OK");
|
|
// } else {
|
|
// await DisplayAlert("Scan Abgebrochen", "Der Barcode-Scan wurde abgebrochen.", "OK");
|
|
// }
|
|
// } catch (Exception ex) {
|
|
// await DisplayAlert("Fehler", $"Ein Fehler ist aufgetreten: {ex.Message}", "OK");
|
|
// }
|
|
//}
|
|
|
|
//private static void BarcodesDetected(object sender, OnDetectionFinishedEventArg e) {
|
|
// if (e.BarcodeResults.Length > 0) {
|
|
// // Hier verarbeiten Sie den erkannten Barcode
|
|
// //Console.WriteLine($"Detected barcode: {e.BarcodeResults.GetType()} {e.BarcodeResults.ToString()}");
|
|
// await DisplayAlert("Scan-Ergebnis", $"Barcode: {e.BarcodeResults.GetType()} {e.BarcodeResults.ToString()}", "OK");
|
|
// }
|
|
//}
|
|
|
|
|
|
|
|
}
|
|
}
|