Refactor Api-Client
Add Exceptionhandler, AlertService JSON-Converter AppSettings via DI Reformat Code
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?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"
|
||||
@@ -19,8 +20,8 @@
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Behaviors>
|
||||
<toolkit:StatusBarBehavior
|
||||
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
|
||||
<toolkit:StatusBarBehavior
|
||||
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
|
||||
StatusBarStyle="LightContent" />
|
||||
</ContentPage.Behaviors>
|
||||
|
||||
@@ -31,20 +32,26 @@
|
||||
<Border>
|
||||
<Border.Padding>
|
||||
<OnPlatform x:TypeArguments="Thickness" Default="0,15,10,0">
|
||||
<On Platform="Android" Value="0,4,10,8"/>
|
||||
<On Platform="WPF" Value="0,15,10,0"/>
|
||||
<On Platform="Android" Value="0,4,10,8" />
|
||||
<On Platform="WPF" Value="0,15,10,0" />
|
||||
</OnPlatform>
|
||||
</Border.Padding>
|
||||
|
||||
<FlexLayout Direction="Row" AlignItems="Start" Wrap="Wrap" JustifyContent="SpaceBetween">
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Label Text="Beginn" VerticalTextAlignment="Center" HorizontalTextAlignment="End" MinimumWidthRequest="60"></Label>
|
||||
<TimePicker x:Name="TimeBegin" HorizontalOptions="Center" Format="HH:mm" MinimumWidthRequest="80" Time="{Binding DayTime.TimeSpanVon}" />
|
||||
<Label Text="Beginn" VerticalTextAlignment="Center" HorizontalTextAlignment="End"
|
||||
MinimumWidthRequest="60">
|
||||
</Label>
|
||||
<TimePicker x:Name="TimeBegin" HorizontalOptions="Center" Format="HH:mm" MinimumWidthRequest="80"
|
||||
Time="{Binding DayTime.TimeSpanVon}" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<HorizontalStackLayout Spacing="10">
|
||||
<Label Text="Ende" VerticalTextAlignment="Center" HorizontalTextAlignment="End" MinimumWidthRequest="60"></Label>
|
||||
<TimePicker x:Name="TimeEnd" Format="HH:mm" MinimumWidthRequest="80" Time="{Binding DayTime.TimeSpanBis}" />
|
||||
<Label Text="Ende" VerticalTextAlignment="Center" HorizontalTextAlignment="End"
|
||||
MinimumWidthRequest="60">
|
||||
</Label>
|
||||
<TimePicker x:Name="TimeEnd" Format="HH:mm" MinimumWidthRequest="80"
|
||||
Time="{Binding DayTime.TimeSpanBis}" />
|
||||
</HorizontalStackLayout>
|
||||
</FlexLayout>
|
||||
</Border>
|
||||
@@ -52,8 +59,8 @@
|
||||
<Border>
|
||||
<Border.Padding>
|
||||
<OnPlatform x:TypeArguments="Thickness" Default="5">
|
||||
<On Platform="Android" Value="5,4,5,8"/>
|
||||
<On Platform="WPF" Value="5"/>
|
||||
<On Platform="Android" Value="5,4,5,8" />
|
||||
<On Platform="WPF" Value="5" />
|
||||
</OnPlatform>
|
||||
</Border.Padding>
|
||||
<!--<Grid ColumnDefinitions="*,*,*">
|
||||
@@ -65,35 +72,45 @@
|
||||
</Picker>
|
||||
</Grid>-->
|
||||
<HorizontalStackLayout>
|
||||
<Picker x:Name="pick_gemeinde" Title="Gemeinde" ItemsSource="{Binding OptionsGemeinde}" SelectedItem="{Binding DayTime.GemeindeAktiv, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}" IsVisible="{Binding GemeindeAktivSet}">
|
||||
<Picker x:Name="pick_gemeinde" Title="Gemeinde" ItemsSource="{Binding OptionsGemeinde}"
|
||||
SelectedItem="{Binding DayTime.GemeindeAktiv, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}"
|
||||
IsVisible="{Binding GemeindeAktivSet}">
|
||||
</Picker>
|
||||
<Picker x:Name="pick_projekt" Title="Projekt" ItemsSource="{Binding OptionsProjekt}" SelectedItem="{Binding DayTime.ProjektAktiv, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}" IsVisible="{Binding ProjektAktivSet}">
|
||||
<Picker x:Name="pick_projekt" Title="Projekt" ItemsSource="{Binding OptionsProjekt}"
|
||||
SelectedItem="{Binding DayTime.ProjektAktiv, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}"
|
||||
IsVisible="{Binding ProjektAktivSet}">
|
||||
</Picker>
|
||||
<Picker x:Name="pick_freistellung" Title="Freistellung" ItemsSource="{Binding OptionsFreistellung}" SelectedItem="{Binding DayTime.FreistellungAktiv, Mode=TwoWay}" ItemDisplayBinding="{Binding Name}" IsEnabled="{Binding FreistellungEnabled}">
|
||||
<Picker x:Name="pick_freistellung" Title="Freistellung" ItemsSource="{Binding OptionsFreistellung}"
|
||||
SelectedItem="{Binding DayTime.FreistellungAktiv, Mode=TwoWay}"
|
||||
ItemDisplayBinding="{Binding Name}" IsEnabled="{Binding FreistellungEnabled}">
|
||||
</Picker>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
|
||||
<Editor Placeholder="Beschreibung" Text="{Binding DayTime.Description}" MinimumHeightRequest="40" AutoSize="TextChanges" FontSize="18" />
|
||||
<Editor Placeholder="Beschreibung" Text="{Binding DayTime.Description}" MinimumHeightRequest="40"
|
||||
AutoSize="TextChanges" FontSize="18" />
|
||||
|
||||
<Grid ColumnDefinitions="*,*" ColumnSpacing="4">
|
||||
<Button Grid.Column="1" Text="Speichern"
|
||||
TextColor="{AppThemeBinding Dark={StaticResource White}, Light={StaticResource White}}"
|
||||
Command="{Binding SaveCommand}" />
|
||||
<Button Grid.Column="0" Text="Löschen"
|
||||
Command="{Binding DeleteConfirmCommand}"
|
||||
IsEnabled="{Binding DayTime.Id, Converter={StaticResource IntBoolConverter}}"
|
||||
<Button Grid.Column="0" Text="Löschen"
|
||||
Command="{Binding DeleteConfirmCommand}"
|
||||
IsEnabled="{Binding DayTime.Id, Converter={StaticResource IntBoolConverter}}"
|
||||
IsVisible="{Binding FreistellungEnabled}"
|
||||
BackgroundColor="{StaticResource Gray500}"
|
||||
TextColor="{AppThemeBinding Dark={StaticResource White}, Light={StaticResource White}}"/>
|
||||
TextColor="{AppThemeBinding Dark={StaticResource White}, Light={StaticResource White}}" />
|
||||
</Grid>
|
||||
|
||||
|
||||
<BoxView HeightRequest="1" Margin="3,10" />
|
||||
|
||||
<Label Text="Noch keine Einträge vorhanden" IsVisible="{Binding DayTimes, Converter={StaticResource CollectionVisibilityConverter}, ConverterParameter=Invert}" Margin="6,0,0,0"/>
|
||||
<Label Text="Noch keine Einträge vorhanden"
|
||||
IsVisible="{Binding DayTimes, Converter={StaticResource CollectionVisibilityConverter}, ConverterParameter=Invert}"
|
||||
Margin="6,0,0,0" />
|
||||
|
||||
<StackLayout Margin="6,0,0,0" IsVisible="{Binding DayTimes, Converter={StaticResource CollectionVisibilityConverter}}">
|
||||
<StackLayout Margin="6,0,0,0"
|
||||
IsVisible="{Binding DayTimes, Converter={StaticResource CollectionVisibilityConverter}}">
|
||||
<Label>
|
||||
<Label.FormattedText>
|
||||
<FormattedString>
|
||||
@@ -105,13 +122,13 @@
|
||||
</StackLayout>
|
||||
|
||||
<ScrollView IsVisible="{Binding DayTimes, Converter={StaticResource CollectionVisibilityConverter}}">
|
||||
<CollectionView
|
||||
ItemsSource="{Binding DayTimes}"
|
||||
x:Name="stundeItems" Margin="0"
|
||||
HeightRequest="350"
|
||||
SelectionMode="Single"
|
||||
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
||||
<CollectionView
|
||||
ItemsSource="{Binding DayTimes}"
|
||||
x:Name="stundeItems" Margin="0"
|
||||
HeightRequest="350"
|
||||
SelectionMode="Single"
|
||||
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
||||
|
||||
<CollectionView.ItemsLayout>
|
||||
<LinearItemsLayout Orientation="Vertical" ItemSpacing="0" />
|
||||
@@ -129,15 +146,18 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<HorizontalStackLayout Grid.Row="0" Grid.Column="0">
|
||||
<Label Grid.Column="0" Text="{Binding Begin}"/>
|
||||
<Label Text="bis" Padding="5,0,5,0"/>
|
||||
<Label Text="{Binding End}"/>
|
||||
<Label Text="{Binding GemeindeAktiv.Name}" Margin="10,0,0,0" IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.GemeindeAktivSet}"/>
|
||||
<Label Text="{Binding ProjektAktiv.Name}" Margin="10,0,0,0" IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.ProjektAktivSet}"/>
|
||||
<Label Text="{Binding FreistellungAktiv.Name}" Margin="10,0,0,0"/>
|
||||
<Label Grid.Column="0" Text="{Binding Begin}" />
|
||||
<Label Text="bis" Padding="5,0,5,0" />
|
||||
<Label Text="{Binding End}" />
|
||||
<Label Text="{Binding GemeindeAktiv.Name}" Margin="10,0,0,0"
|
||||
IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.GemeindeAktivSet}" />
|
||||
<Label Text="{Binding ProjektAktiv.Name}" Margin="10,0,0,0"
|
||||
IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.ProjektAktivSet}" />
|
||||
<Label Text="{Binding FreistellungAktiv.Name}" Margin="10,0,0,0" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Description}" Padding="0,0,0,15"/>
|
||||
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Description}"
|
||||
Padding="0,0,0,15" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
|
||||
Reference in New Issue
Block a user