Files
2026-10-11 22:19:34 +02:00

100 lines
5.0 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:loc="clr-namespace:cfs_tracker.Helpers"
xmlns:views="clr-namespace:cfs_tracker.Views"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:MonthViewModel"
Title="{loc:Translate Tab_Month}"
BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,Auto,Auto,*"
Padding="16"
RowSpacing="12">
<Grid Grid.Row="0"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="12">
<Button Text="◀"
Command="{Binding PreviousMonthCommand}"
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 NextMonthCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
</Grid>
<Grid Grid.Row="1"
ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="{loc:Translate Common_Today}"
Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1"
Text="{loc:Translate Common_Export}"
Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" />
</Grid>
<Grid Grid.Row="2"
ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="6"
Padding="2,0">
<Label Text="{loc:Translate Common_Weekday_Mon}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="{loc:Translate Common_Weekday_Tue}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="{loc:Translate Common_Weekday_Wed}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="{loc:Translate Common_Weekday_Thu}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="{loc:Translate Common_Weekday_Fri}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="{loc:Translate Common_Weekday_Sat}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="{loc:Translate Common_Weekday_Sun}" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
</Grid>
<CollectionView Grid.Row="3"
ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7"
VerticalItemSpacing="6"
HorizontalItemSpacing="6" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Stroke="{Binding BorderColor}"
BackgroundColor="{Binding BackgroundColor}"
StrokeShape="RoundRectangle 10"
Padding="6"
MinimumHeightRequest="58">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.OpenDayCommand, x:DataType=views:MonthPage}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Grid>
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontAttributes="Bold"
FontSize="15"
TextColor="{Binding TextColor}" />
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>