Beautifiing Login Process
This commit is contained in:
@@ -5,11 +5,13 @@ using Microsoft.Maui.Dispatching;
|
||||
|
||||
namespace Jugenddienst_Stunden.ViewModels {
|
||||
internal class AboutViewModel {
|
||||
public string Title => AppInfo.Name;
|
||||
public string AppTitle => AppInfo.Name;
|
||||
public string Version => AppInfo.VersionString;
|
||||
|
||||
public string Message => "Scanne den QR-Code von deinem Benutzerprofil auf der Stundenseite.";
|
||||
|
||||
public string Title { get; set; } = Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", "");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,31 +3,27 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
||||
xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
|
||||
x:Class="Jugenddienst_Stunden.Views.AboutPage">
|
||||
x:Class="Jugenddienst_Stunden.Views.AboutPage"
|
||||
Title="{Binding Title}">
|
||||
|
||||
<ContentPage.BindingContext>
|
||||
<models:AboutViewModel />
|
||||
</ContentPage.BindingContext>
|
||||
|
||||
<VerticalStackLayout Spacing="10" Margin="10">
|
||||
<VerticalStackLayout Spacing="10" Margin="15">
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Image Source="dotnet_bot.png"
|
||||
SemanticProperties.Description="The dot net bot waving hello!"
|
||||
HeightRequest="64" />
|
||||
<Label FontSize="22" FontAttributes="Bold" Text="{Binding Title}" VerticalOptions="End" />
|
||||
<Label FontSize="22" FontAttributes="Bold" Text="{Binding AppTitle}" VerticalOptions="End" />
|
||||
<Label FontSize="22" Text="{Binding Version}" VerticalOptions="End" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<Label Text="{Binding Message}" />
|
||||
|
||||
|
||||
|
||||
<Label Text="{Binding Message}" HeightRequest="110" />
|
||||
|
||||
<zxing:CameraBarcodeReaderView x:Name="barcodeScannerView"
|
||||
BarcodesDetected="BarcodesDetected"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand"
|
||||
Margin="0,60,0,0"/>
|
||||
VerticalOptions="FillAndExpand"/>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
|
||||
|
||||
@@ -36,13 +36,13 @@ public partial class AboutPage : ContentPage {
|
||||
var op = await Models.Operator.LoadData(barcode.Value);
|
||||
Preferences.Default.Set("name", op.name);
|
||||
Preferences.Default.Set("surname", op.surname);
|
||||
DisplayAlert("Neuer Barcode erkannt", op.name + " " + op.surname, "OK");
|
||||
|
||||
DisplayAlert("Login erfolgreich", op.name + " " + op.surname, "OK");
|
||||
Title = op.name + " " + op.surname;
|
||||
|
||||
});
|
||||
} else {
|
||||
MainThread.InvokeOnMainThreadAsync(() => {
|
||||
DisplayAlert("Barcode bereits vorhanden",
|
||||
DisplayAlert("Bereits eingeloggt",
|
||||
Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", ""),
|
||||
"OK");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user