Anpassungen Detailseite
Auswahlliste Gemeinden und Projekte
This commit is contained in:
@@ -15,13 +15,13 @@
|
||||
<ToolbarItem Text="Add" Command="{Binding NewCommand}" IconImageSource="{FontImage Glyph='+', Color=Black, Size=22}" />
|
||||
</ContentPage.ToolbarItems>
|
||||
|
||||
<VerticalStackLayout>
|
||||
<VerticalStackLayout Margin="20,0,0,0">
|
||||
<Label Text="Werden nur lokal gespeichert"/>
|
||||
|
||||
<!-- Display notes in a list -->
|
||||
<CollectionView x:Name="notesCollection"
|
||||
ItemsSource="{Binding AllNotes}"
|
||||
Margin="20"
|
||||
Margin="0,20,0,0"
|
||||
SelectionMode="Single"
|
||||
SelectionChangedCommand="{Binding SelectNoteCommand}"
|
||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
</HorizontalStackLayout>
|
||||
|
||||
|
||||
<Label Text="{Binding Message}" HeightRequest="110" />
|
||||
<Label Text="{Binding Message}" HeightRequest="40" />
|
||||
<Label Text="{Binding Server}" HeightRequest="40" Margin="0,0,0,40" />
|
||||
|
||||
<zxing:CameraBarcodeReaderView x:Name="barcodeScannerView"
|
||||
BarcodesDetected="BarcodesDetected"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Jugenddienst_Stunden.Models;
|
||||
using Jugenddienst_Stunden.ViewModels;
|
||||
using Microsoft.Maui.Controls;
|
||||
using System.Collections.Generic;
|
||||
using ZXing.Net.Maui;
|
||||
@@ -9,6 +10,7 @@ public partial class LoginPage : ContentPage {
|
||||
|
||||
private DateTime _lastDetectionTime;
|
||||
private readonly TimeSpan _detectionInterval = TimeSpan.FromSeconds(5);
|
||||
private readonly LoginViewModel _loginViewModel = new LoginViewModel();
|
||||
|
||||
public LoginPage() {
|
||||
InitializeComponent();
|
||||
@@ -42,6 +44,9 @@ public partial class LoginPage : ContentPage {
|
||||
Preferences.Default.Set("apiKey", barcode.Value);
|
||||
Preferences.Default.Set("name", op.name);
|
||||
Preferences.Default.Set("surname", op.surname);
|
||||
//Preferences.Default.Set("apiUrl", Pre);
|
||||
_loginViewModel.Server = Preferences.Default.Get("apiUrl", "");
|
||||
|
||||
|
||||
await DisplayAlert("Login erfolgreich", op.name + " " + op.surname, "OK");
|
||||
} catch (Exception e) {
|
||||
@@ -51,8 +56,6 @@ public partial class LoginPage : ContentPage {
|
||||
"OK");
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
MainThread.InvokeOnMainThreadAsync(() => {
|
||||
@@ -64,17 +67,6 @@ public partial class LoginPage : ContentPage {
|
||||
}
|
||||
}
|
||||
|
||||
//if (first is null) {
|
||||
// return;
|
||||
//}
|
||||
//Dispatcher.DispatchAsync(async () => {
|
||||
// await DisplayAlert("Scan-Ergebnis", $"Barcode: {first.Value}", "OK");
|
||||
//});
|
||||
//MainThread.InvokeOnMainThreadAsync(() => {
|
||||
// DisplayAlert("Barcode erkannt", $"Barcode: {first.Format} - {first.Value}", "OK");
|
||||
// Models.Stunde.apiKey = first.Value;
|
||||
//});
|
||||
|
||||
}
|
||||
|
||||
protected override void OnDisappearing() {
|
||||
@@ -90,6 +82,4 @@ public partial class LoginPage : ContentPage {
|
||||
barcodeScannerView.IsDetecting = true;
|
||||
barcodeScannerView.CameraLocation = CameraLocation.Rear;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,22 +3,22 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:viewModels="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
||||
x:Class="Jugenddienst_Stunden.Views.NotePage"
|
||||
Title="Note">
|
||||
Title="Notiz">
|
||||
<ContentPage.BindingContext>
|
||||
<viewModels:NoteViewModel />
|
||||
</ContentPage.BindingContext>
|
||||
<VerticalStackLayout Spacing="10" Margin="5">
|
||||
<Editor x:Name="TextEditor"
|
||||
Placeholder="Enter your note"
|
||||
Placeholder="Gib deine Notiz ein"
|
||||
Text="{Binding Text}"
|
||||
HeightRequest="80" />
|
||||
|
||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="4">
|
||||
<Button Text="Save"
|
||||
<Button Text="Speichern"
|
||||
Command="{Binding SaveCommand}" />
|
||||
|
||||
<Button Grid.Column="1"
|
||||
Text="Delete"
|
||||
Text="Löschen"
|
||||
Command="{Binding DeleteCommand}" />
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
|
||||
@@ -12,6 +12,30 @@
|
||||
<VerticalStackLayout Spacing="10" Margin="10">
|
||||
<Label Text="{Binding SubTitle}" />
|
||||
|
||||
<Grid ColumnDefinitions="*,*,*">
|
||||
<Picker x:Name="pick_gemeinde" Title="Gemeinde" ItemsSource="{Binding OptionsGemeinde}" SelectedItem="{Binding SelectedOptionGemeinde, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}" Grid.Column="0" >
|
||||
</Picker>
|
||||
<Picker x:Name="pick_projekt" Title="Projekt" ItemsSource="{Binding OptionsProjekt}" SelectedItem="{Binding SelectedOptionProjekt, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}" Grid.Column="1" >
|
||||
</Picker>
|
||||
<Picker x:Name="pick_freistellung" Title="Freistellung" ItemsSource="{Binding OptionsFreistellung}" SelectedItem="{Binding SelectedOptionFreistellung, Mode=TwoWay}" Grid.Column="2" >
|
||||
</Picker>
|
||||
</Grid>
|
||||
|
||||
<FlexLayout Direction="Row" AlignItems="Start" Wrap="Wrap">
|
||||
<Border Background="LightGreen">
|
||||
<HorizontalStackLayout>
|
||||
<Label Text="Beginn" TextColor="Gray" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label>
|
||||
<TimePicker x:Name="TimeBegin" HorizontalOptions="Center" TextColor="Gray" Format="HH:mm" MinimumWidthRequest="80" Time="{Binding Stunde.TimeSpanVon}" />
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
<Border Background="OrangeRed">
|
||||
<HorizontalStackLayout>
|
||||
<Label Text="Ende" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label>
|
||||
<TimePicker x:Name="TimeEnd" TextColor="White" Format="HH:mm" MinimumWidthRequest="80" Time="{Binding Stunde.TimeSpanBis}" />
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
</FlexLayout>
|
||||
|
||||
<Grid Padding="5,10,5,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -21,11 +45,13 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<HorizontalStackLayout Grid.Row="0" Grid.Column="0">
|
||||
<Label Grid.Row="0" Grid.Column="0" Text="{Binding Stunde.begin}"/>
|
||||
<Label Text="bis" Padding="10,0,10,0"/>
|
||||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Stunde.end}"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
|
||||
<!--<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Stunde.description}" Padding="0,0,0,5"/>-->
|
||||
|
||||
@@ -34,9 +60,7 @@
|
||||
|
||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="4">
|
||||
<Button Text="Save" />
|
||||
|
||||
<Button Grid.Column="1"
|
||||
Text="Delete" />
|
||||
<Button Grid.Column="1" Text="Delete" />
|
||||
</Grid>
|
||||
</VerticalStackLayout>
|
||||
</ContentPage>
|
||||
Reference in New Issue
Block a user