Files
cfs-Tracker/Views/WeekPage.xaml
T
2026-10-11 22:19:34 +02:00

118 lines
6.5 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="cfs_tracker.Views.WeekPage"
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:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:WeekViewModel"
Title="{loc:Translate Tab_Week}"
BackgroundColor="{DynamicResource AppBackground}">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Grid ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousWeekCommand}" />
<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 NextWeekCommand}" />
</Grid>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="{loc:Translate Common_Today}"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="{loc:Translate Common_Export}"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<CollectionView ItemsSource="{Binding Days}"
SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:WeekDaySummaryViewModel">
<Border Margin="0,0,0,12"
Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:WeekViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:WeekViewModel'}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*"
ColumnSpacing="10">
<Label Text="{Binding DateText}"
FontAttributes="Bold"
FontSize="18"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Border Padding="10"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding MorningColor}">
<VerticalStackLayout Spacing="4">
<Label Text="{loc:Translate Common_Morning}"
FontAttributes="Bold"
TextColor="White" />
<Label Text="{Binding MorningText}"
TextColor="White" />
</VerticalStackLayout>
</Border>
<Border Grid.Column="1"
Padding="10"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding AfternoonColor}">
<VerticalStackLayout Spacing="4">
<Label Text="{loc:Translate Common_Afternoon}"
FontAttributes="Bold"
TextColor="White" />
<Label Text="{Binding AfternoonText}"
TextColor="White" />
</VerticalStackLayout>
</Border>
</Grid>
<Button Text="{Binding DetailsButtonText}"
IsVisible="{Binding HasDetails}"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ToggleExpandedCommand}" />
<VerticalStackLayout IsVisible="{Binding IsExpanded}"
Spacing="6">
<Label Text="{Binding ActivitiesSummaryText}"
IsVisible="{Binding HasActivities}"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding SymptomsSummaryText}"
IsVisible="{Binding HasSymptoms}"
TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>