Export Option
Added export function
This commit is contained in:
@@ -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:MonthViewModel"
|
||||
Title="Monat"
|
||||
@@ -76,7 +77,7 @@
|
||||
Padding="6"
|
||||
MinimumHeightRequest="58">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
|
||||
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.OpenDayCommand, x:DataType=views:MonthPage}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</Border.GestureRecognizers>
|
||||
|
||||
@@ -94,4 +95,4 @@
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
</ContentPage>
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace cfs_tracker.Views;
|
||||
public partial class MonthPage : ContentPage
|
||||
{
|
||||
private readonly MonthViewModel _viewModel;
|
||||
public MonthViewModel ViewModel => _viewModel;
|
||||
|
||||
public MonthPage(MonthViewModel viewModel)
|
||||
{
|
||||
|
||||
+130
-21
@@ -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>
|
||||
|
||||
@@ -12,6 +12,7 @@ public partial class OptionsPage : ContentPage
|
||||
private static readonly Regex HexColorRegex = new("^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$", RegexOptions.Compiled);
|
||||
|
||||
private readonly OptionsViewModel _viewModel;
|
||||
public OptionsViewModel ViewModel => _viewModel;
|
||||
private bool _isLoading;
|
||||
private bool _appearanceEditorsBuilt;
|
||||
private bool _appearanceEditorsDirty = true;
|
||||
|
||||
@@ -4,40 +4,12 @@
|
||||
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:QuickEntryViewModel"
|
||||
Title="Eintrag"
|
||||
BackgroundColor="{DynamicResource AppBackground}">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<Style x:Key="SymptomToggleBorderStyle" TargetType="Border">
|
||||
<Setter Property="Padding" Value="12,10" />
|
||||
<Setter Property="StrokeThickness" Value="1" />
|
||||
<Setter Property="Stroke" Value="{DynamicResource Border}" />
|
||||
<Setter Property="StrokeShape" Value="RoundRectangle 12" />
|
||||
<Setter Property="BackgroundColor" Value="{DynamicResource ButtonPrimaryBackground}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger TargetType="Border"
|
||||
Binding="{Binding IsSelected}"
|
||||
Value="True">
|
||||
<Setter Property="BackgroundColor" Value="{DynamicResource ButtonSecondaryBackground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SymptomToggleLabelStyle" TargetType="Label">
|
||||
<Setter Property="VerticalOptions" Value="Center" />
|
||||
<Setter Property="TextColor" Value="{DynamicResource ButtonPrimaryText}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger TargetType="Label"
|
||||
Binding="{Binding IsSelected}"
|
||||
Value="True">
|
||||
<Setter Property="TextColor" Value="{DynamicResource ButtonSecondaryText}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="16" Spacing="16">
|
||||
|
||||
@@ -63,7 +35,7 @@
|
||||
TextColor="{DynamicResource TextPrimary}" />
|
||||
<Picker Title="Tageszeit"
|
||||
ItemsSource="{Binding Parts}"
|
||||
ItemDisplayBinding="{Binding Name, x:DataType={x:Null}}"
|
||||
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:DayPartOptionItemViewModel}"
|
||||
SelectedItem="{Binding SelectedPart}" />
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
@@ -78,7 +50,7 @@
|
||||
TextColor="{DynamicResource TextPrimary}" />
|
||||
<Picker Title="Tätigkeit"
|
||||
ItemsSource="{Binding Activities}"
|
||||
ItemDisplayBinding="{Binding Name, x:DataType={x:Null}}"
|
||||
ItemDisplayBinding="{Binding Name, x:DataType=viewModels:ActivityPickerItemViewModel}"
|
||||
SelectedItem="{Binding SelectedActivity}" />
|
||||
|
||||
<Label Text="Dauer (HH:mm)"
|
||||
@@ -109,7 +81,7 @@
|
||||
BackgroundColor="{DynamicResource ButtonPrimaryBackground}">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer
|
||||
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleSymptomCommand}"
|
||||
Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.ToggleSymptomCommand, x:DataType=views:QuickEntryPage}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</Border.GestureRecognizers>
|
||||
|
||||
@@ -223,4 +195,4 @@
|
||||
HorizontalOptions="Fill" />
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
</ContentPage>
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace cfs_tracker.Views;
|
||||
public partial class QuickEntryPage : ContentPage, IQueryAttributable
|
||||
{
|
||||
private readonly QuickEntryViewModel _vm;
|
||||
public QuickEntryViewModel ViewModel => _vm;
|
||||
|
||||
public QuickEntryPage(QuickEntryViewModel vm)
|
||||
{
|
||||
@@ -31,4 +32,4 @@ public partial class QuickEntryPage : ContentPage, IQueryAttributable
|
||||
statusValue?.ToString(),
|
||||
commitValue?.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -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:YearViewModel"
|
||||
Title="Jahr"
|
||||
@@ -88,7 +89,7 @@
|
||||
Padding="3"
|
||||
MinimumHeightRequest="30">
|
||||
<Border.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
|
||||
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=ViewModel.OpenDayCommand, x:DataType=views:YearPage}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</Border.GestureRecognizers>
|
||||
|
||||
@@ -110,4 +111,4 @@
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
</ContentPage>
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace cfs_tracker.Views;
|
||||
public partial class YearPage : ContentPage
|
||||
{
|
||||
private readonly YearViewModel _viewModel;
|
||||
public YearViewModel ViewModel => _viewModel;
|
||||
|
||||
public YearPage(YearViewModel viewModel)
|
||||
{
|
||||
@@ -28,4 +29,4 @@ public partial class YearPage : ContentPage
|
||||
await DisplayAlertAsync("Fehler", ex.ToString(), "OK");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user