Farbpalette vorladen lassen

Bootstraper läd jetzt die farbeinstellung sofort und nicht nachträglich

cleanup and rework

PDF switch to HTML

export fix

Colorsystem

Farben für knöpfe hinzugefügt als anpassung

button color

button color primary and secondary change
This commit is contained in:
2026-03-23 22:42:52 +01:00
parent d5649dc189
commit d85f2e0fb3
84 changed files with 4216 additions and 1814 deletions
+132 -188
View File
@@ -1,210 +1,154 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="cfs_tracker.Views.DayPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Name="ThisPage"
Title="Tag">
<ContentPage x:Class="cfs_tracker.Views.DayPage"
x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:DayViewModel"
Title="Tag"
BackgroundColor="{DynamicResource AppBackground}">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="14">
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
<Button
Grid.Column="0"
Text="◀"
WidthRequest="52"
HeightRequest="44"
Command="{Binding PreviousDayCommand}" />
<Label
Grid.Column="1"
Text="{Binding SelectedDateText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="22"
FontAttributes="Bold" />
<Button
Grid.Column="2"
Text="Heute"
Margin="8,0,0,0"
Command="{Binding TodayCommand}" />
<Button
Grid.Column="3"
Text="+"
Margin="8,0,0,0"
WidthRequest="52"
HeightRequest="44"
Command="{Binding AddEntryCommand}" />
<VerticalStackLayout Padding="16" Spacing="16">
<Grid ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousDayCommand}" />
<Label Grid.Column="1"
Text="{Binding SelectedDateText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2"
Text="→"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding NextDayCommand}" />
</Grid>
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" ColumnSpacing="10" RowSpacing="10">
<Border
Grid.Row="0"
Grid.Column="0"
BackgroundColor="{DynamicResource StateGreen}"
StrokeThickness="0"
StrokeShape="RoundRectangle 12"
Padding="12">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding SaveGreenQuickCommand}" />
</Border.GestureRecognizers>
<VerticalStackLayout>
<Label Text="{Binding GreenStatusText}" TextColor="White" FontAttributes="Bold" />
<Label Text="{Binding GreenCount}" TextColor="White" FontSize="22" />
</VerticalStackLayout>
</Border>
<Border
Grid.Row="0"
Grid.Column="1"
BackgroundColor="{DynamicResource StateYellow}"
StrokeThickness="0"
StrokeShape="RoundRectangle 12"
Padding="12">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding SaveYellowQuickCommand}" />
</Border.GestureRecognizers>
<VerticalStackLayout>
<Label Text="{Binding YellowStatusText}" TextColor="White" FontAttributes="Bold" />
<Label Text="{Binding YellowCount}" TextColor="White" FontSize="22" />
</VerticalStackLayout>
</Border>
<Border
Grid.Row="1"
Grid.Column="0"
BackgroundColor="{DynamicResource StateRed}"
StrokeThickness="0"
StrokeShape="RoundRectangle 12"
Padding="12">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding SaveRedQuickCommand}" />
</Border.GestureRecognizers>
<VerticalStackLayout>
<Label Text="{Binding RedStatusText}" TextColor="White" FontAttributes="Bold" />
<Label Text="{Binding RedCount}" TextColor="White" FontSize="22" />
</VerticalStackLayout>
</Border>
<Border
Grid.Row="1"
Grid.Column="1"
BackgroundColor="{DynamicResource StateGray}"
StrokeThickness="0"
StrokeShape="RoundRectangle 12"
Padding="12">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding SaveGrayQuickCommand}" />
</Border.GestureRecognizers>
<VerticalStackLayout>
<Label Text="{Binding GrayStatusText}" TextColor="White" FontAttributes="Bold" />
<Label Text="{Binding GrayCount}" TextColor="White" FontSize="22" />
</VerticalStackLayout>
</Border>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<Label
Text="Einträge"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,*"
RowDefinitions="Auto,Auto"
ColumnSpacing="12"
RowSpacing="12">
<Button Grid.Row="0"
Grid.Column="0"
Text="{Binding GreenCounterText}"
HeightRequest="92"
Command="{Binding SaveGreenQuickCommand}"
BackgroundColor="{Binding GreenStateColor}"
TextColor="White" />
<CollectionView
ItemsSource="{Binding Entries}"
SelectionMode="None">
<Button Grid.Row="0"
Grid.Column="1"
Text="{Binding YellowCounterText}"
HeightRequest="92"
Command="{Binding SaveYellowQuickCommand}"
BackgroundColor="{Binding YellowStateColor}"
TextColor="Black" />
<Button Grid.Row="1"
Grid.Column="0"
Text="{Binding RedCounterText}"
HeightRequest="92"
Command="{Binding SaveRedQuickCommand}"
BackgroundColor="{Binding RedStateColor}"
TextColor="White" />
<Button Grid.Row="1"
Grid.Column="1"
Text="{Binding GrayCounterText}"
HeightRequest="92"
Command="{Binding SaveGrayQuickCommand}"
BackgroundColor="{Binding GrayStateColor}"
TextColor="White" />
</Grid>
<Button Text="{Binding AddEntryButtonText}"
Command="{Binding AddEntryCommand}"
Style="{StaticResource PrimaryButtonStyle}"
IsEnabled="{Binding CanAddEntry}" />
<Label Text="Noch keine Einträge vorhanden."
IsVisible="{Binding HasNoEntries}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource TextMuted}" />
<CollectionView ItemsSource="{Binding Entries}"
SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate>
<Border
Margin="0,0,0,8"
Padding="12"
BackgroundColor="{Binding BackgroundColor}"
StrokeThickness="0"
StrokeShape="RoundRectangle 12">
<VerticalStackLayout Spacing="8">
<Grid ColumnDefinitions="Auto,*,Auto" ColumnSpacing="12">
<Label
Grid.Column="0"
Text="{Binding TimeText}"
TextColor="{Binding TextColor}"
FontAttributes="Bold"
VerticalOptions="Center" />
<VerticalStackLayout Grid.Column="1" Spacing="2">
<Label
Text="{Binding StateText}"
TextColor="{Binding TextColor}"
FontAttributes="Bold" />
<Button
Text="{Binding FoldoutText}"
Command="{Binding ToggleExpandedCommand}"
IsVisible="{Binding HasDetails}"
Padding="0"
FontSize="12"
BackgroundColor="Transparent"
TextColor="{Binding TextColor}"
HorizontalOptions="Start" />
<DataTemplate x:DataType="viewModels:DayEntryItemViewModel">
<Border Margin="0,0,0,12"
Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*,Auto,Auto"
ColumnSpacing="10">
<VerticalStackLayout Spacing="4">
<Label Text="{Binding SlotText}"
FontAttributes="Bold"
TextColor="{DynamicResource TextMuted}" />
<Label Text="{Binding StateText}"
FontSize="18"
FontAttributes="Bold"
TextColor="{Binding ForegroundColor}" />
</VerticalStackLayout>
<Button
Grid.Column="2"
Text="X"
WidthRequest="44"
HeightRequest="44"
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.DeleteEntryCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Bearbeiten"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.EditEntryCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Löschen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteEntryCommand}"
CommandParameter="{Binding .}" />
</Grid>
<Border
IsVisible="{Binding IsExpanded}"
Padding="10"
BackgroundColor="{DynamicResource PanelBackground2}"
Stroke="{DynamicResource PanelBorder}"
StrokeThickness="1"
StrokeShape="RoundRectangle 10">
<VerticalStackLayout Spacing="6">
<VerticalStackLayout IsVisible="{Binding HasActivity}" Spacing="2">
<Label
Text="Tätigkeit"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label
Text="{Binding ActivityText}"
TextColor="{DynamicResource TextMuted}" />
</VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding HasSymptoms}" Spacing="2">
<Label
Text="Symptome"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label
Text="{Binding SymptomsText}"
TextColor="{DynamicResource TextMuted}" />
</VerticalStackLayout>
</VerticalStackLayout>
<Border Padding="8"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding StateText}"
FontAttributes="Bold"
TextColor="{Binding ForegroundColor}" />
</Border>
<Button Text="{Binding DetailsButtonText}"
IsVisible="{Binding HasDetails}"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ToggleExpandedCommand}" />
<VerticalStackLayout IsVisible="{Binding IsExpanded}"
Spacing="6">
<Label Text="{Binding ActivityText, StringFormat='Tätigkeit: {0}'}"
IsVisible="{Binding HasActivity}"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding SymptomsText, StringFormat='Symptome: {0}'}"
IsVisible="{Binding HasSymptoms}"
TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
</ContentPage>
+1 -1
View File
@@ -17,4 +17,4 @@ public partial class DayPage : ContentPage
base.OnAppearing();
await _viewModel.RefreshAsync();
}
}
}
+86 -94
View File
@@ -1,100 +1,92 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="cfs_tracker.Views.MonthPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Name="ThisPage"
Title="Monat">
<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:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:MonthViewModel"
Title="Monat"
BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,Auto,*" Padding="16">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Grid ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousMonthCommand}" />
<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 NextMonthCommand}" />
</Grid>
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" Margin="0,0,0,12">
<Button
Grid.Column="0"
Text="◀"
WidthRequest="52"
HeightRequest="44"
Command="{Binding PreviousMonthCommand}" />
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<Label
Grid.Column="1"
Text="{Binding SelectedMonthText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="24"
FontAttributes="Bold" />
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
</Grid>
<Button
Grid.Column="2"
Text="Heute"
Margin="8,0,0,0"
Command="{Binding TodayCommand}" />
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Margin="2"
Padding="6"
Stroke="{Binding BorderColor}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 10">
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Button
Grid.Column="3"
Text="▶"
WidthRequest="52"
HeightRequest="44"
Margin="8,0,0,0"
Command="{Binding NextMonthCommand}" />
</Grid>
<Grid Grid.Row="1" ColumnDefinitions="*,*,*,*,*,*,*" Margin="0,0,0,8">
<Label Grid.Column="0" Text="Mo" HorizontalTextAlignment="Center" FontAttributes="Bold" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" FontAttributes="Bold" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" FontAttributes="Bold" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" FontAttributes="Bold" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" FontAttributes="Bold" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" FontAttributes="Bold" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" FontAttributes="Bold" />
</Grid>
<CollectionView
Grid.Row="2"
ItemsSource="{Binding Days}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="7" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="3">
<Border
HeightRequest="74"
BackgroundColor="{Binding BackgroundColor}"
Stroke="{Binding BorderColor}"
StrokeThickness="1"
StrokeShape="RoundRectangle 10">
<Grid Padding="6">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Grid.GestureRecognizers>
<VerticalStackLayout
IsVisible="{Binding IsRealDay}"
Spacing="4">
<Label
Text="{Binding DayNumberText}"
TextColor="{Binding TextColor}"
FontAttributes="Bold"
FontSize="16" />
<Label
Text="{Binding CountText}"
TextColor="{Binding TextColor}"
FontSize="12" />
</VerticalStackLayout>
</Grid>
</Border>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>
<VerticalStackLayout Spacing="4">
<Label Text="{Binding DayNumberText}"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
<Border Padding="4"
StrokeThickness="0"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding AverageStateText}"
FontSize="11"
HorizontalTextAlignment="Center"
TextColor="White" />
</Border>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
+15 -3
View File
@@ -1,8 +1,20 @@
using cfs_tracker.ViewModels;
namespace cfs_tracker.Views;
public partial class MonthPage : ContentPage
{
private readonly MonthViewModel _vm;
public MonthPage(MonthViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.RefreshAsync(); }
private readonly MonthViewModel _viewModel;
public MonthPage(MonthViewModel viewModel)
{
InitializeComponent();
BindingContext = _viewModel = viewModel;
}
protected override async void OnAppearing()
{
base.OnAppearing();
await _viewModel.RefreshAsync();
}
}
+302 -113
View File
@@ -1,129 +1,318 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="cfs_tracker.Views.OptionsPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:conv="clr-namespace:cfs_tracker.Converters"
Title="Optionen">
<ContentPage.Resources>
<ResourceDictionary>
<conv:HexToColorConverter x:Key="HexToColorConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage x:Class="cfs_tracker.Views.OptionsPage"
x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:OptionsViewModel"
Title="Optionen"
BackgroundColor="{DynamicResource AppBackground}">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Label Text="Optionen"
FontSize="28"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label
Text="Optionen"
FontSize="26"
FontAttributes="Bold" />
<Label Text="{Binding StatusText}"
TextColor="{DynamicResource TextMuted}" />
<Label
Text="Aussehen"
FontSize="22"
FontAttributes="Bold" />
<Label
Text="Farben"
FontSize="18"
FontAttributes="Bold" />
<CollectionView ItemsSource="{Binding AppearanceColors}" SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate>
<Border Padding="12" Margin="0,0,0,8">
<VerticalStackLayout Spacing="8">
<Label
Text="{Binding Title}"
FontAttributes="Bold" />
<Grid ColumnDefinitions="*,60" ColumnSpacing="10">
<Entry
Grid.Column="0"
Text="{Binding Value}"
Placeholder="#RRGGBB" />
<Border
Grid.Column="1"
HeightRequest="42"
WidthRequest="42"
Padding="0"
Stroke="{DynamicResource PanelBorder}"
StrokeThickness="1"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding Value, Converter={StaticResource HexToColorConverter}}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Label
Text="Status-Texte"
FontSize="18"
FontAttributes="Bold" />
<CollectionView ItemsSource="{Binding StatusTexts}" SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate>
<Border Padding="12" Margin="0,0,0,8">
<VerticalStackLayout Spacing="6">
<Label
Text="{Binding Title}"
FontAttributes="Bold" />
<Entry
Text="{Binding Value}" />
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<HorizontalStackLayout Spacing="10">
<Button
Text="Aussehen speichern"
Command="{Binding SaveAppearanceCommand}" />
<Button
Text="Standard wiederherstellen"
Command="{Binding ResetAppearanceCommand}" />
</HorizontalStackLayout>
<Label
Text="Datenbank"
FontSize="22"
FontAttributes="Bold" />
<Border Padding="14">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="12">
<Label
Text="Alle Einträge löschen"
FontSize="18"
FontAttributes="Bold" />
<Label Text="Aussehen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label
Text="Zur Bestätigung das Wort 'löschen' eingeben." />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding AppearanceColors}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:AppearanceColorItemViewModel">
<Grid ColumnDefinitions="*,120"
ColumnSpacing="10"
Padding="0,6">
<VerticalStackLayout>
<Label Text="{Binding Title}"
TextColor="{DynamicResource TextPrimary}" />
<Entry Text="{Binding Value}"
Placeholder="#112233" />
</VerticalStackLayout>
<Entry
Placeholder="löschen"
Text="{Binding DeleteConfirmationText}" />
<Border Grid.Column="1"
Padding="8"
Stroke="{DynamicResource Border}"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding PreviewColor}">
<Label Text="{Binding Value}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
TextColor="{DynamicResource TextPrimary}" />
</Border>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Button
Text="Alle Daten löschen"
BackgroundColor="#A85C5C"
Command="{Binding DeleteAllDataCommand}" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding StatusTexts}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:AppearanceTextItemViewModel">
<VerticalStackLayout Spacing="4"
Padding="0,6">
<Label Text="{Binding Title}"
TextColor="{DynamicResource TextPrimary}" />
<Entry Text="{Binding Value}" />
</VerticalStackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveAppearanceCommand}" />
<Button Grid.Column="1"
Text="Zurücksetzen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ResetAppearanceCommand}" />
</Grid>
</VerticalStackLayout>
</Border>
<Label
Text="{Binding StatusText}"
FontSize="13" />
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="12">
<Label Text="Tätigkeiten"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10">
<Entry Text="{Binding NewActivityName}"
Placeholder="Neue Tätigkeit" />
<Button Grid.Column="1"
Text="Hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddActivityCommand}" />
</Grid>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Activities}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:ActivityManageItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
StrokeShape="RoundRectangle 10"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Entry Text="{Binding Name}" />
<Label Text="{Binding UsageHint}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveActivityCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleActivityActiveCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteActivityCommand}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="12">
<Label Text="Symptome"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10">
<Entry Text="{Binding NewSymptomName}"
Placeholder="Neues Symptom" />
<Button Grid.Column="1"
Text="Hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddSymptomCommand}" />
</Grid>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:SymptomManageItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
StrokeShape="RoundRectangle 10"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Entry Text="{Binding Name}" />
<Label Text="{Binding UsageHint}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveSymptomCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleSymptomActiveCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteSymptomCommand}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="12">
<Label Text="Push-Benachrichtigungen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="Text: 'Wie geht es dir?' mit Schnellwahl für Gelb, Rot und Grau/Schwarz."
TextColor="{DynamicResource TextMuted}" />
<Button Text="Zeit hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddScheduleCommand}" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding NotificationSchedules}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:NotificationScheduleItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
StrokeShape="RoundRectangle 10"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Picker Title="Wochentag"
ItemsSource="{Binding WeekdayOptions}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding SelectedWeekday}" />
<TimePicker Time="{Binding SelectedTime}" />
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8">
<CheckBox IsChecked="{Binding IsEnabled}" />
<Label Grid.Column="1"
Text="Aktiv"
VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
<Button Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteScheduleCommand}"
CommandParameter="{Binding .}" />
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Button Text="Benachrichtigungszeiten speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveSchedulesCommand}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="12">
<Label Text="Datenbank"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding CurrentDatabasePath, StringFormat='Aktiver Pfad: {0}'}"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8">
<CheckBox IsChecked="{Binding UseExternalDatabase}" />
<Label Grid.Column="1"
Text="Externe Datenbank verwenden"
VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
<Entry Text="{Binding ExternalDatabasePath}"
Placeholder="Ordner oder Dateipfad für externe DB" />
<Button Text="Datenbankpfad speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveDatabaseLocationCommand}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="12">
<Label Text="Alle Einträge löschen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="Zum Bestätigen 'löschen' eingeben."
TextColor="{DynamicResource TextMuted}" />
<Entry Text="{Binding DeleteConfirmationText}"
Placeholder="löschen" />
<Button Text="Alles löschen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding DeleteAllDataCommand}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="10">
<Label Text="Export"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Text="Export entleeren"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearExportsCommand}" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
</ContentPage>
+1 -1
View File
@@ -17,4 +17,4 @@ public partial class OptionsPage : ContentPage
base.OnAppearing();
await _viewModel.LoadAsync();
}
}
}
+153 -19
View File
@@ -1,23 +1,157 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="cfs_tracker.Views.QuickEntryPage"
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Eintrag">
<ScrollView><VerticalStackLayout Padding="20" Spacing="18">
<Label Text="Wie geht es dir?" FontSize="28" FontAttributes="Bold" HorizontalTextAlignment="Center" />
<Label Text="{Binding SelectedDateText}" FontSize="16" HorizontalTextAlignment="Center" />
<VerticalStackLayout IsVisible="{Binding IsPastDate}" Spacing="8">
<Label Text="Tageszeit" FontAttributes="Bold" HorizontalTextAlignment="Center" />
<Picker Title="Tageszeit" ItemsSource="{Binding AvailableParts}" SelectedItem="{Binding SelectedPartText}" />
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:QuickEntryViewModel"
x:Class="cfs_tracker.Views.QuickEntryPage"
Title="Eintrag"
BackgroundColor="{DynamicResource AppBackground}">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Label Text="{Binding SelectedDateText}"
FontSize="20"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding ModeText}"
IsVisible="{Binding IsFutureDate}"
HorizontalTextAlignment="Center"
TextColor="IndianRed" />
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14"
IsVisible="{Binding IsPastDate}">
<VerticalStackLayout Spacing="8">
<Label Text="Nachtrag"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Picker Title="Tageszeit"
ItemsSource="{Binding Parts}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding SelectedPart}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="8">
<Label Text="Tätigkeit"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Picker Title="Tätigkeit"
ItemsSource="{Binding Activities}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding SelectedActivity}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="8">
<Label Text="Symptome"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}"
Spacing="6">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:SelectableSymptomItemViewModel">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="10"
Padding="0,4">
<CheckBox IsChecked="{Binding IsSelected}" />
<Label Grid.Column="1"
Text="{Binding Name}"
VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
<Grid ColumnDefinitions="*,*"
RowDefinitions="Auto,Auto"
ColumnSpacing="12"
RowSpacing="12">
<Button Grid.Row="0"
Grid.Column="0"
Text="{Binding GreenStatusText}"
FontSize="22"
FontAttributes="Bold"
HeightRequest="110"
BackgroundColor="{Binding GreenStateColor}"
TextColor="White"
Command="{Binding SaveGreenCommand}"
IsEnabled="{Binding CanSave}" />
<Button Grid.Row="0"
Grid.Column="1"
Text="{Binding YellowStatusText}"
FontSize="22"
FontAttributes="Bold"
HeightRequest="110"
BackgroundColor="{Binding YellowStateColor}"
TextColor="Black"
Command="{Binding SaveYellowCommand}"
IsEnabled="{Binding CanSave}" />
<Button Grid.Row="1"
Grid.Column="0"
Text="{Binding RedStatusText}"
FontSize="22"
FontAttributes="Bold"
HeightRequest="110"
BackgroundColor="{Binding RedStateColor}"
TextColor="White"
Command="{Binding SaveRedCommand}"
IsEnabled="{Binding CanSave}" />
<Button Grid.Row="1"
Grid.Column="1"
Text="{Binding GrayStatusText}"
FontSize="22"
FontAttributes="Bold"
HeightRequest="110"
BackgroundColor="{Binding GrayStateColor}"
TextColor="White"
Command="{Binding SaveGrayCommand}"
IsEnabled="{Binding CanSave}" />
</Grid>
<Border Padding="12"
IsVisible="{Binding ShowSaveButton}"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="10">
<Label Text="{Binding SelectedStateSummaryText}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource TextPrimary}" />
<Button Text="Eintrag speichern"
Command="{Binding SaveCommand}"
IsEnabled="{Binding CanExplicitSave}"
Style="{StaticResource PrimaryButtonStyle}"
HorizontalOptions="Fill" />
</VerticalStackLayout>
</Border>
<Button Text="Abbrechen"
Command="{Binding CancelCommand}"
Style="{StaticResource SecondaryButtonStyle}"
HorizontalOptions="Fill" />
</VerticalStackLayout>
<Border Padding="12"><VerticalStackLayout Spacing="8"><Label Text="Tätigkeit" FontAttributes="Bold" /><Picker Title="Tätigkeit" ItemsSource="{Binding Activities}" ItemDisplayBinding="{Binding Name}" SelectedItem="{Binding SelectedActivity}" /></VerticalStackLayout></Border>
<Border Padding="12"><VerticalStackLayout Spacing="8"><Label Text="Symptome" FontAttributes="Bold" /><CollectionView ItemsSource="{Binding Symptoms}" SelectionMode="None"><CollectionView.ItemTemplate><DataTemplate><Grid ColumnDefinitions="Auto,*" Padding="0,4"><CheckBox IsChecked="{Binding IsSelected}" /><Label Grid.Column="1" Text="{Binding Name}" VerticalOptions="Center" /></Grid></DataTemplate></CollectionView.ItemTemplate></CollectionView></VerticalStackLayout></Border>
<Label IsVisible="{Binding IsFutureDate}" Text="Für zukünftige Tage können keine Einträge gesetzt werden." TextColor="{StaticResource StateRed}" HorizontalTextAlignment="Center" />
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" ColumnSpacing="12" RowSpacing="12">
<Button Grid.Row="0" Grid.Column="0" Text="Grün&#10;Gut" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateGreen}" TextColor="White" Command="{Binding SaveGreenCommand}" />
<Button Grid.Row="0" Grid.Column="1" Text="Gelb&#10;So lala" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateYellow}" TextColor="Black" Command="{Binding SaveYellowCommand}" />
<Button Grid.Row="1" Grid.Column="0" Text="Rot&#10;Schlecht" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateRed}" TextColor="White" Command="{Binding SaveRedCommand}" />
<Button Grid.Row="1" Grid.Column="1" Text="Grau&#10;Totalausfall" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateGray}" TextColor="White" Command="{Binding SaveGrayCommand}" />
</Grid>
</VerticalStackLayout></ScrollView>
</ContentPage>
</ScrollView>
</ContentPage>
+31 -5
View File
@@ -1,10 +1,36 @@
using Microsoft.Maui.Controls;
using cfs_tracker.ViewModels;
namespace cfs_tracker.Views;
public partial class QuickEntryPage : ContentPage, IQueryAttributable
{
private readonly QuickEntryViewModel _vm;
public QuickEntryPage(QuickEntryViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.LoadLookupsAsync(); }
public void ApplyQueryAttributes(IDictionary<string, object> query){ query.TryGetValue("date", out var value); _vm.SetDateFromQuery(value?.ToString()); }
}
private bool _initialized;
public QuickEntryPage(QuickEntryViewModel vm)
{
InitializeComponent();
BindingContext = _vm = vm;
}
protected override async void OnAppearing()
{
base.OnAppearing();
if (_initialized)
return;
_initialized = true;
await _vm.InitializeAsync();
}
public void ApplyQueryAttributes(IDictionary<string, object> query)
{
query.TryGetValue("date", out var dateValue);
query.TryGetValue("entryId", out var entryIdValue);
_vm.ApplyQuery(
dateValue?.ToString() ?? string.Empty,
entryIdValue?.ToString());
}
}
+107 -132
View File
@@ -1,142 +1,117 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="cfs_tracker.Views.WeekPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Name="ThisPage"
Title="Woche">
<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:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:WeekViewModel"
Title="Woche"
BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,*" Padding="16">
<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 Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" Margin="0,0,0,12">
<Button
Grid.Column="0"
Text="◀"
WidthRequest="52"
HeightRequest="44"
Command="{Binding PreviousWeekCommand}" />
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<Label
Grid.Column="1"
Text="{Binding WeekText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="22"
FontAttributes="Bold" />
<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={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Button
Grid.Column="2"
Text="Heute"
Margin="8,0,0,0"
Command="{Binding TodayCommand}" />
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*"
ColumnSpacing="10">
<Label Text="{Binding DateText}"
FontAttributes="Bold"
FontSize="18"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
<Button
Grid.Column="3"
Text="▶"
WidthRequest="52"
HeightRequest="44"
Margin="8,0,0,0"
Command="{Binding NextWeekCommand}" />
</Grid>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Border Padding="10"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding MorningColor}">
<VerticalStackLayout Spacing="4">
<Label Text="Vormittag"
FontAttributes="Bold"
TextColor="White" />
<Label Text="{Binding MorningText}"
TextColor="White" />
</VerticalStackLayout>
</Border>
<CollectionView
Grid.Row="1"
ItemsSource="{Binding Days}"
SelectionMode="None">
<Border Grid.Column="1"
Padding="10"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
BackgroundColor="{Binding AfternoonColor}">
<VerticalStackLayout Spacing="4">
<Label Text="Nachmittag"
FontAttributes="Bold"
TextColor="White" />
<Label Text="{Binding AfternoonText}"
TextColor="White" />
</VerticalStackLayout>
</Border>
</Grid>
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical" ItemSpacing="10" />
</CollectionView.ItemsLayout>
<Button Text="{Binding DetailsButtonText}"
IsVisible="{Binding HasDetails}"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ToggleExpandedCommand}" />
<CollectionView.ItemTemplate>
<DataTemplate>
<Border
Padding="12"
BackgroundColor="{DynamicResource PanelBackground}"
Stroke="{DynamicResource PanelBorder}"
StrokeThickness="1"
StrokeShape="RoundRectangle 12">
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*,Auto">
<VerticalStackLayout>
<Label
Text="{Binding DayText}"
FontAttributes="Bold"
FontSize="18"
TextColor="{DynamicResource TextPrimary}" />
<Label
Text="{Binding DateText}"
FontSize="13"
TextColor="{DynamicResource TextMuted}" />
<VerticalStackLayout IsVisible="{Binding IsExpanded}"
Spacing="6">
<Label Text="{Binding ActivitiesText, StringFormat='Tätigkeiten: {0}'}"
IsVisible="{Binding HasActivities}"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding SymptomsText, StringFormat='Symptome: {0}'}"
IsVisible="{Binding HasSymptoms}"
TextColor="{DynamicResource TextPrimary}" />
</VerticalStackLayout>
</Grid>
<Grid ColumnDefinitions="*,*" ColumnSpacing="10">
<Border
Grid.Column="0"
BackgroundColor="{Binding MorningBackgroundColor}"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
Padding="10">
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<VerticalStackLayout>
<Label
Text="Vormittag"
FontAttributes="Bold"
TextColor="{Binding MorningTextColor}" />
<Label
Text="{Binding MorningText}"
FontSize="18"
TextColor="{Binding MorningTextColor}" />
<Label
Text="{Binding MorningCountText}"
FontSize="12"
TextColor="{Binding MorningTextColor}" />
</VerticalStackLayout>
</Border>
<Border
Grid.Column="1"
BackgroundColor="{Binding AfternoonBackgroundColor}"
StrokeThickness="0"
StrokeShape="RoundRectangle 10"
Padding="10">
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<VerticalStackLayout>
<Label
Text="Nachmittag"
FontAttributes="Bold"
TextColor="{Binding AfternoonTextColor}" />
<Label
Text="{Binding AfternoonText}"
FontSize="18"
TextColor="{Binding AfternoonTextColor}" />
<Label
Text="{Binding AfternoonCountText}"
FontSize="12"
TextColor="{Binding AfternoonTextColor}" />
</VerticalStackLayout>
</Border>
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
+15 -3
View File
@@ -1,8 +1,20 @@
using cfs_tracker.ViewModels;
namespace cfs_tracker.Views;
public partial class WeekPage : ContentPage
{
private readonly WeekViewModel _vm;
public WeekPage(WeekViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.RefreshAsync(); }
private readonly WeekViewModel _viewModel;
public WeekPage(WeekViewModel viewModel)
{
InitializeComponent();
BindingContext = _viewModel = viewModel;
}
protected override async void OnAppearing()
{
base.OnAppearing();
await _viewModel.RefreshAsync();
}
}
+102 -115
View File
@@ -1,128 +1,115 @@
<?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">
<ContentPage x:Class="cfs_tracker.Views.YearPage"
x:Name="RootPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:cfs_tracker.ViewModels"
x:DataType="viewModels:YearViewModel"
Title="Jahr"
BackgroundColor="{DynamicResource AppBackground}">
<Grid RowDefinitions="Auto,*" Padding="16">
<Grid Padding="16"
RowSpacing="16"
RowDefinitions="Auto,Auto,*">
<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 ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousYearCommand}" />
<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 NextYearCommand}" />
</Grid>
<ScrollView Grid.Row="1">
<VerticalStackLayout
Spacing="12"
BindableLayout.ItemsSource="{Binding Months}">
<Grid Grid.Row="1"
ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<BindableLayout.ItemTemplate>
<DataTemplate>
<Border
Padding="12"
BackgroundColor="{DynamicResource PanelBackground}"
Stroke="{DynamicResource PanelBorder}"
StrokeThickness="1"
StrokeShape="RoundRectangle 12">
<CollectionView Grid.Row="2"
ItemsSource="{Binding Months}"
SelectionMode="None"
VerticalOptions="Fill"
HorizontalOptions="Fill"
ItemSizingStrategy="MeasureFirstItem">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthSectionViewModel">
<Border Padding="12"
Margin="0,0,0,12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="10">
<Label Text="{Binding Title}"
FontSize="18"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<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}"
<FlexLayout Direction="Row"
Wrap="Wrap"
AlignItems="Start"
JustifyContent="Start"
BindableLayout.ItemsSource="{Binding Cells}">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Margin="2"
Padding="4"
WidthRequest="46"
HeightRequest="46"
Stroke="{Binding BorderColor}"
StrokeThickness="1"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}"
StrokeShape="RoundRectangle 8">
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<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 RowDefinitions="Auto,*">
<Label Text="{Binding DayNumberText}"
FontSize="11"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
TextColor="{Binding TextColor}" />
<Border Grid.Row="1"
Margin="0,4,0,0"
Padding="2"
StrokeThickness="0"
StrokeShape="RoundRectangle 5"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding AverageStateText}"
FontSize="9"
LineBreakMode="TailTruncation"
MaxLines="1"
HorizontalTextAlignment="Center"
TextColor="White" />
</Border>
</Grid>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>
+27 -4
View File
@@ -1,8 +1,31 @@
using System.Diagnostics;
using cfs_tracker.ViewModels;
namespace cfs_tracker.Views;
public partial class YearPage : ContentPage
{
private readonly YearViewModel _vm;
public YearPage(YearViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.RefreshAsync(); }
}
private readonly YearViewModel _viewModel;
public YearPage(YearViewModel viewModel)
{
InitializeComponent();
BindingContext = _viewModel = viewModel;
}
protected override async void OnAppearing()
{
base.OnAppearing();
try
{
await _viewModel.RefreshAsync();
}
catch (Exception ex)
{
Debug.WriteLine("YearPage crash:");
Debug.WriteLine(ex.ToString());
await DisplayAlertAsync("Fehler", ex.ToString(), "OK");
}
}
}