Files
cfs-Tracker/Views/MonthPage.xaml
T
Djagor 7b824b6f0c Layout fixes and Push fixes
- Layout und Kalender angepasst
- Push status meldung angepasst für Android
2026-03-27 11:58:53 +01:00

104 lines
5.6 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="cfs_tracker.Views.MonthPage"
x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:MonthViewModel"
Title="Monat"
BackgroundColor="{DynamicResource AppBackground}">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Grid ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousMonthCommand}" />
<Label Grid.Column="1"
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2"
Text="→"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding NextMonthCommand}" />
</Grid>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
</Grid>
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Margin="2"
Padding="6"
Stroke="{Binding BorderColor}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 10">
<Border.Triggers>
<DataTrigger TargetType="Border"
Binding="{Binding IsPlaceholder}"
Value="True">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="StrokeThickness" Value="0" />
</DataTrigger>
</Border.Triggers>
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:MonthViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:MonthViewModel'}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<VerticalStackLayout Spacing="4">
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
<Border Padding="4"
IsVisible="{Binding ShowAverage}"
StrokeThickness="0"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding AverageStateText}"
FontSize="11"
HorizontalTextAlignment="Center"
TextColor="White" />
</Border>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>