Files
cfs-Tracker/Views/YearPage.xaml
T
Djagor 142c318d33 Export Option
Added export function
2026-04-01 10:34:06 +02:00

115 lines
6.5 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="cfs_tracker.Views.YearPage"
x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:YearViewModel"
Title="Jahr"
BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,Auto,*"
Padding="16"
RowSpacing="12">
<Grid Grid.Row="0"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="12">
<Button Text="◀"
Command="{Binding PreviousYearCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Label Grid.Column="1"
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="22"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2"
Text="▶"
Command="{Binding NextYearCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
</Grid>
<Grid Grid.Row="1"
ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1"
Text="Export"
Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" />
</Grid>
<ScrollView Grid.Row="2">
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Months}"
Spacing="14">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthSectionViewModel">
<Border Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 12"
Padding="10">
<VerticalStackLayout Spacing="8">
<Label Text="{Binding Title}"
FontSize="18"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
</Grid>
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7"
VerticalItemSpacing="4"
HorizontalItemSpacing="4" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Stroke="{Binding BorderColor}"
BackgroundColor="{Binding BackgroundColor}"
StrokeShape="RoundRectangle 8"
Padding="3"
MinimumHeightRequest="30">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.OpenDayCommand, x:DataType=views:YearPage}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="11"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ContentPage>