Export Option

Added export function
This commit is contained in:
2026-04-01 10:34:06 +02:00
parent cf3d7557aa
commit 142c318d33
14 changed files with 628 additions and 87 deletions
+130 -21
View File
@@ -3,6 +3,7 @@
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:OptionsViewModel"
Title="Optionen"
@@ -91,6 +92,21 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Text="Export"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowExportTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsExportTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</FlexLayout>
</Border>
@@ -332,7 +348,7 @@
<Button Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteScheduleCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteScheduleCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
</VerticalStackLayout>
</Border>
@@ -347,6 +363,112 @@
</Border>
</VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding IsExportTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Export"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="Lege Zeitraum und Darstellung fest. Nach dem Erstellen kannst du den Export direkt öffnen oder teilen."
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<VerticalStackLayout Spacing="4">
<Label Text="Von"
TextColor="{DynamicResource TextPrimary}" />
<DatePicker Date="{Binding ExportStartDate}"
MaximumDate="{Binding ExportEndDate}" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1"
Spacing="4">
<Label Text="Bis"
TextColor="{DynamicResource TextPrimary}" />
<DatePicker Date="{Binding ExportEndDate}"
MinimumDate="{Binding ExportStartDate}" />
</VerticalStackLayout>
</Grid>
<Label Text="{Binding ExportRangeSummary}"
TextColor="{DynamicResource TextMuted}" />
<Label Text="Exportmodus"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<FlexLayout Direction="Row"
Wrap="Wrap"
AlignItems="Start"
JustifyContent="Start">
<Button Text="Tagesansicht"
Style="{StaticResource DayToggleButtonStyle}"
Margin="0,0,10,10"
Command="{Binding SelectDayViewExportLayoutCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsDayViewExportLayoutSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Text="Wochenblock"
Style="{StaticResource DayToggleButtonStyle}"
Margin="0,0,10,10"
Command="{Binding SelectWeekBlockExportLayoutCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsWeekBlockExportLayoutSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Text="Tageszusammenfassung"
Style="{StaticResource DayToggleButtonStyle}"
Margin="0,0,10,10"
Command="{Binding SelectDaySummaryExportLayoutCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsDaySummaryExportLayoutSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</FlexLayout>
<Label Text="{Binding SelectedExportLayoutDescription}"
TextColor="{DynamicResource TextMuted}" />
<Button Text="Export erstellen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportSelectedRangeCommand}" />
<Button Text="Export entleeren"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearExportsCommand}" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding IsDataManagementTabSelected}"
Spacing="16">
<Border Padding="12"
@@ -384,17 +506,17 @@
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveActivityCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.SaveActivityCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleActivityActiveCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleActivityActiveCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteActivityCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteActivityCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
@@ -440,17 +562,17 @@
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveSymptomCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.SaveSymptomCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleSymptomActiveCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomActiveCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteSymptomCommand}"
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.DeleteSymptomCommand, x:DataType=views:OptionsPage}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
@@ -512,19 +634,6 @@
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="10">
<Label Text="Export"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Text="Export entleeren"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearExportsCommand}" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
@@ -664,4 +773,4 @@
</Border>
</Grid>
</Grid>
</ContentPage>
</ContentPage>