72 lines
3.6 KiB
XML
72 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
|
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
|
xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
|
|
xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter"
|
|
x:Class="Jugenddienst_Stunden.Views.LoginPage"
|
|
Title="{Binding Title}">
|
|
|
|
|
|
<ContentPage.BindingContext>
|
|
<models:LoginViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<ContentPage.Resources>
|
|
<ResourceDictionary>
|
|
<conv:StringVisibilityConverter x:Key="StringVisibilityConverter" />
|
|
</ResourceDictionary>
|
|
</ContentPage.Resources>
|
|
|
|
<ContentPage.Behaviors>
|
|
<toolkit:StatusBarBehavior
|
|
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
|
|
StatusBarStyle="LightContent" />
|
|
</ContentPage.Behaviors>
|
|
|
|
<ScrollView>
|
|
<VerticalStackLayout Spacing="10" Margin="15,0">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<HorizontalStackLayout Spacing="5" HorizontalOptions="Start" Grid.Column="0">
|
|
<Label FontSize="20" FontAttributes="Bold" Text="{Binding AppTitle}" Margin="0,7,0,0" />
|
|
<Label FontSize="16" Text="{Binding Version}" Margin="0,11,0,0" />
|
|
</HorizontalStackLayout>
|
|
<Grid Grid.Column="1" ColumnDefinitions="*,50" ColumnSpacing="10">
|
|
<Label Text="Login QR/manuell" VerticalOptions="Center" Grid.Column="0"/>
|
|
<Switch x:Name="LoginSwitch" IsToggled="False" Toggled="Switch_Toggled" VerticalOptions="Center" Grid.Column="1"/>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<Label x:Name="ServerLabel" Text="{Binding Server}" IsVisible="{Binding Server, Converter={StaticResource StringVisibilityConverter}}" />
|
|
|
|
<VerticalStackLayout x:Name="LoginQR" Margin="0,20,0,0">
|
|
<Label Text="Login mit QR-Code" FontSize="32" HorizontalOptions="Start" />
|
|
<Label x:Name="Message" Text="{Binding Message}" Margin="0,15" />
|
|
|
|
<Border HeightRequest="300" Padding="0">
|
|
<zxing:CameraBarcodeReaderView
|
|
x:Name="barcodeScannerView"
|
|
BarcodesDetected="BarcodesDetected"
|
|
HorizontalOptions="FillAndExpand"
|
|
VerticalOptions="FillAndExpand"/>
|
|
</Border>
|
|
</VerticalStackLayout>
|
|
|
|
<VerticalStackLayout x:Name="LoginManual" Spacing="25">
|
|
<Label Text="Manueller Login" FontSize="32" HorizontalOptions="Start" Margin="0, 20, 0, 0" />
|
|
<Entry x:Name="UsernameEntry" Placeholder="Benutzername (Mailadresse)" Keyboard="Email" />
|
|
<Entry x:Name="PasswordEntry" Placeholder="Passwort" IsPassword="True" />
|
|
<Entry x:Name="ServerEntry" Placeholder="Server (gleich wie im Browser)" Keyboard="Url" />
|
|
<Button Text="Login" Clicked="OnLoginButtonClicked" TextColor="{AppThemeBinding Dark={StaticResource White}, Light={StaticResource White}}" />
|
|
</VerticalStackLayout>
|
|
</VerticalStackLayout>
|
|
|
|
</ScrollView>
|
|
|
|
|
|
</ContentPage> |