Files
cfs-Tracker/Views/YearPage.xaml
T
2026-03-23 16:26:55 +01:00

128 lines
6.3 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="cfs_tracker.Views.YearPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Name="ThisPage"
Title="Jahr">
<Grid RowDefinitions="Auto,*" Padding="16">
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" Margin="0,0,0,12">
<Button
Grid.Column="0"
Text="◀"
WidthRequest="52"
HeightRequest="44"
Command="{Binding PreviousYearCommand}" />
<Label
Grid.Column="1"
Text="{Binding SelectedYearText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="24"
FontAttributes="Bold" />
<Button
Grid.Column="2"
Text="Heute"
Margin="8,0,0,0"
Command="{Binding TodayCommand}" />
<Button
Grid.Column="3"
Text="▶"
WidthRequest="52"
HeightRequest="44"
Margin="8,0,0,0"
Command="{Binding NextYearCommand}" />
</Grid>
<ScrollView Grid.Row="1">
<VerticalStackLayout
Spacing="12"
BindableLayout.ItemsSource="{Binding Months}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Border
Padding="12"
BackgroundColor="{DynamicResource PanelBackground}"
Stroke="{DynamicResource PanelBorder}"
StrokeThickness="1"
StrokeShape="RoundRectangle 12">
<VerticalStackLayout Spacing="10">
<Label
Text="{Binding MonthText}"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<HorizontalStackLayout Spacing="4">
<Label Text="Mo" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
<Label Text="Di" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
<Label Text="Mi" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
<Label Text="Do" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
<Label Text="Fr" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
<Label Text="Sa" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
<Label Text="So" WidthRequest="44" HorizontalTextAlignment="Center" FontSize="12" />
</HorizontalStackLayout>
<FlexLayout
Direction="Row"
Wrap="Wrap"
JustifyContent="Start"
AlignItems="Start"
BindableLayout.ItemsSource="{Binding Days}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Border
WidthRequest="44"
HeightRequest="44"
Margin="2"
BackgroundColor="{Binding BackgroundColor}"
Stroke="{Binding BorderColor}"
StrokeThickness="1"
StrokeShape="RoundRectangle 8">
<Grid Padding="4">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Grid.GestureRecognizers>
<VerticalStackLayout
IsVisible="{Binding IsRealDay}"
Spacing="1">
<Label
Text="{Binding DayNumberText}"
TextColor="{Binding TextColor}"
FontSize="11"
FontAttributes="Bold"
HorizontalTextAlignment="Center" />
<Label
Text="{Binding CountText}"
TextColor="{Binding TextColor}"
FontSize="9"
HorizontalTextAlignment="Center" />
</VerticalStackLayout>
</Grid>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ContentPage>