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"
|
||||
@@ -8,52 +9,51 @@
|
||||
x:Class="Jugenddienst_Stunden.Views.StundenPage"
|
||||
Title="{Binding Title}">
|
||||
|
||||
<ContentPage.BindingContext>
|
||||
<models:StundenViewModel />
|
||||
</ContentPage.BindingContext>
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<conv:SecondsTimeConverter x:Key="secToTime" />
|
||||
<FontImageSource x:Key="ToolbarIcon"
|
||||
Glyph="+"
|
||||
Size="22"
|
||||
Color="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/>
|
||||
Glyph="+"
|
||||
Size="22"
|
||||
Color="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
</ResourceDictionary>
|
||||
</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>
|
||||
|
||||
<ContentPage.ToolbarItems>
|
||||
<!--<ToolbarItem Text="Lade Liste" Command="{Binding RefreshListCommand}"/>-->
|
||||
<ToolbarItem Text="Neuer Eintrag" IconImageSource="{StaticResource ToolbarIcon}" Command="{Binding NewEntryCommand}" />
|
||||
<ToolbarItem Text="Neuer Eintrag" IconImageSource="{StaticResource ToolbarIcon}"
|
||||
Command="{Binding NewEntryCommand}" />
|
||||
</ContentPage.ToolbarItems>
|
||||
|
||||
<RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}" Margin="10" Padding="10">
|
||||
<RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}"
|
||||
Margin="10" Padding="10">
|
||||
<Grid RowDefinitions="50,*,Auto,80">
|
||||
<!--<VerticalStackLayout Spacing="10" Margin="10">-->
|
||||
<!--<VerticalStackLayout Spacing="10" Margin="10">-->
|
||||
|
||||
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto,*" HeightRequest="50" Grid.Row="0">
|
||||
<DatePicker Grid.Column="0" MinimumDate="{Binding MinimumDate}"
|
||||
MaximumDate="{Binding MaximumDate}"
|
||||
Date="{Binding DateToday}" Format="dddd, d. MMMM yyyy" />
|
||||
MaximumDate="{Binding MaximumDate}"
|
||||
Date="{Binding DateToday}" Format="dddd, d. MMMM yyyy" />
|
||||
<Border Grid.Column="1" Margin="15,0,0,0" Padding="15,0,0,0" ToolTipProperties.Text="Tagessumme">
|
||||
<HorizontalStackLayout>
|
||||
<Label Text="{Binding DayTotal,StringFormat='{}{0:HH:mm}'}" VerticalOptions="Center"></Label>
|
||||
<Label Text="/" VerticalOptions="Center" Margin="3,0"/>
|
||||
<Label Text="/" VerticalOptions="Center" Margin="3,0" />
|
||||
<Label Text="{Binding Sollstunden,StringFormat='{}{0:HH:mm}'}" VerticalOptions="Center"></Label>
|
||||
</HorizontalStackLayout>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<CollectionView
|
||||
ItemsSource="{Binding DayTimes}"
|
||||
<CollectionView
|
||||
ItemsSource="{Binding DayTimes}"
|
||||
x:Name="stundeItems" Margin="0,0,0,20"
|
||||
|
||||
|
||||
SelectionMode="Single"
|
||||
SelectionChangedCommand="{Binding SelectEntryCommand}"
|
||||
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}"
|
||||
@@ -72,27 +72,29 @@
|
||||
<VisualStateGroup Name="CommonStates">
|
||||
<VisualState Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource TransparentColor}}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource TransparentColor}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState Name="Selected">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
|
||||
|
||||
<HorizontalStackLayout>
|
||||
<HorizontalStackLayout.Triggers>
|
||||
<DataTrigger TargetType="HorizontalStackLayout" Binding="{Binding Approved}" Value="True">
|
||||
<DataTrigger TargetType="HorizontalStackLayout" Binding="{Binding Approved}"
|
||||
Value="True">
|
||||
<Setter Property="BackgroundColor" Value="LightCoral" />
|
||||
<Setter Property="Padding" Value="4"/>
|
||||
<Setter Property="Padding" Value="4" />
|
||||
</DataTrigger>
|
||||
</HorizontalStackLayout.Triggers>
|
||||
<Label Text="{Binding Day, StringFormat='{0:dddd, dd. MMMM}'}"/>
|
||||
<Label Text="{Binding Day, StringFormat='{0:dddd, dd. MMMM}'}" />
|
||||
<Label Text="von" Padding="5,0,5,0" />
|
||||
<Label Text="{Binding Begin}" />
|
||||
<Label Text="bis" Padding="5,0,5,0" />
|
||||
@@ -101,27 +103,30 @@
|
||||
|
||||
<HorizontalStackLayout HorizontalOptions="FillAndExpand">
|
||||
<HorizontalStackLayout.Triggers>
|
||||
<DataTrigger TargetType="HorizontalStackLayout" Binding="{Binding Approved}" Value="True">
|
||||
<DataTrigger TargetType="HorizontalStackLayout" Binding="{Binding Approved}"
|
||||
Value="True">
|
||||
<Setter Property="BackgroundColor" Value="LightCoral" />
|
||||
<Setter Property="Padding" Value="4"/>
|
||||
<Setter Property="Padding" Value="4" />
|
||||
</DataTrigger>
|
||||
</HorizontalStackLayout.Triggers>
|
||||
<Label Text="{Binding GemeindeAktiv.Name}" Margin="0,0,10,0" IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.GemeindeAktivSet}" />
|
||||
<Label Text="{Binding ProjektAktiv.Name}" Margin="0,0,10,0" IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.ProjektAktivSet}" />
|
||||
<Label Text="{Binding GemeindeAktiv.Name}" Margin="0,0,10,0"
|
||||
IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.GemeindeAktivSet}" />
|
||||
<Label Text="{Binding ProjektAktiv.Name}" Margin="0,0,10,0"
|
||||
IsVisible="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.ProjektAktivSet}" />
|
||||
<Label Text="{Binding FreistellungAktiv.Name}" IsVisible="{Binding Approved}" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<Label Text="{Binding Description}" Padding="0,0,0,15"/>
|
||||
<Label Text="{Binding Description}" Padding="0,0,0,15" />
|
||||
</VerticalStackLayout>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
|
||||
</CollectionView>
|
||||
|
||||
|
||||
<!--<BoxView HeightRequest="1" Grid.Row="2" Margin="0,5,0,15" />-->
|
||||
<Button Text="{Binding LoadOverview}"
|
||||
Grid.Row="2"
|
||||
Command="{Binding LoadDataCommand}"
|
||||
<Button Text="{Binding LoadOverview}"
|
||||
Grid.Row="2"
|
||||
Command="{Binding LoadDataCommand}"
|
||||
TextColor="{AppThemeBinding Dark={StaticResource White}, Light={StaticResource White}}" />
|
||||
<Border Padding="2" Grid.Row="3" Margin="0,10,0,0">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" ColumnDefinitions="Auto,Auto,*,Auto" Margin="10,2">
|
||||
@@ -133,15 +138,23 @@
|
||||
<Label Grid.Row="1" Grid.Column="2" Text="Zeitausgleich:" Margin="15,0,0,0" />
|
||||
<Label Grid.Row="2" Grid.Column="2" Text="Resturlaub:" Margin="15,0,0,0" />
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Nominal, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Sollstunden" />
|
||||
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding ZeitCalculated, Converter={StaticResource secToTime}}" ToolTipProperties.Text="Geleistete Stunden" />
|
||||
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding OvertimeMonth, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="0" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Overtime, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="1" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Zeitausgleich, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="2" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0" Text="{Binding Holiday, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="0" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0"
|
||||
Text="{Binding Nominal, Converter={StaticResource secToTime}}"
|
||||
ToolTipProperties.Text="Sollstunden" />
|
||||
<Label Grid.Row="1" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0"
|
||||
Text="{Binding ZeitCalculated, Converter={StaticResource secToTime}}"
|
||||
ToolTipProperties.Text="Geleistete Stunden" />
|
||||
<Label Grid.Row="2" Grid.Column="1" HorizontalTextAlignment="End" Padding="0,0,5,0"
|
||||
Text="{Binding OvertimeMonth, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="0" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0"
|
||||
Text="{Binding Overtime, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="1" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0"
|
||||
Text="{Binding Zeitausgleich, Converter={StaticResource secToTime}}" />
|
||||
<Label Grid.Row="2" Grid.Column="3" HorizontalTextAlignment="End" Padding="0,0,5,0"
|
||||
Text="{Binding Holiday, Converter={StaticResource secToTime}}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
</Grid>
|
||||
<!--</VerticalStackLayout>-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user