Details ausgearbeitet
Linked colors to options menu Options extension Aussehen aufgebohrt: - erlaubt text von status zu ändern, - bessere beschriftung von Farben desing änderung und bedienung - heute status felder anklickbar, - Farbpalette verdunkelt und kontrast reduziert - Kalender Tage anklickbar gemacht - Optionen überarbeitet
This commit is contained in:
+126
-29
@@ -42,37 +42,85 @@
|
||||
|
||||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" ColumnSpacing="10" RowSpacing="10">
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="0" BackgroundColor="#4CAF50" StrokeThickness="0" StrokeShape="RoundRectangle 12" Padding="12">
|
||||
<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="Grün" TextColor="White" FontAttributes="Bold" />
|
||||
<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="#FBC02D" StrokeThickness="0" StrokeShape="RoundRectangle 12" Padding="12">
|
||||
<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="Gelb" FontAttributes="Bold" />
|
||||
<Label Text="{Binding YellowCount}" FontSize="22" />
|
||||
<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="#E53935" StrokeThickness="0" StrokeShape="RoundRectangle 12" Padding="12">
|
||||
<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="Rot" TextColor="White" FontAttributes="Bold" />
|
||||
<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="#757575" StrokeThickness="0" StrokeShape="RoundRectangle 12" Padding="12">
|
||||
<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="Grau" TextColor="White" FontAttributes="Bold" />
|
||||
<Label Text="{Binding GrayStatusText}" TextColor="White" FontAttributes="Bold" />
|
||||
<Label Text="{Binding GrayCount}" TextColor="White" FontSize="22" />
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
<CollectionView ItemsSource="{Binding Entries}" SelectionMode="None">
|
||||
<Label
|
||||
Text="Einträge"
|
||||
FontSize="20"
|
||||
FontAttributes="Bold"
|
||||
TextColor="{DynamicResource TextPrimary}" />
|
||||
|
||||
<CollectionView
|
||||
ItemsSource="{Binding Entries}"
|
||||
SelectionMode="None">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
@@ -82,27 +130,76 @@
|
||||
StrokeThickness="0"
|
||||
StrokeShape="RoundRectangle 12">
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" ColumnSpacing="12">
|
||||
<Label
|
||||
Grid.Column="0"
|
||||
Text="{Binding TimeText}"
|
||||
TextColor="{Binding TextColor}"
|
||||
FontAttributes="Bold"
|
||||
VerticalOptions="Center" />
|
||||
<VerticalStackLayout Spacing="8">
|
||||
|
||||
<VerticalStackLayout Grid.Column="1" Spacing="2">
|
||||
<Label Text="{Binding StateText}" TextColor="{Binding TextColor}" FontAttributes="Bold" />
|
||||
<Label Text="{Binding SourceText}" TextColor="{Binding TextColor}" FontSize="12" />
|
||||
</VerticalStackLayout>
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" ColumnSpacing="12">
|
||||
<Label
|
||||
Grid.Column="0"
|
||||
Text="{Binding TimeText}"
|
||||
TextColor="{Binding TextColor}"
|
||||
FontAttributes="Bold"
|
||||
VerticalOptions="Center" />
|
||||
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
Text="X"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.DeleteEntryCommand}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</Grid>
|
||||
<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" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
Text="X"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Command="{Binding Source={x:Reference ThisPage}, 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>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
|
||||
+24
-95
@@ -1,96 +1,25 @@
|
||||
<?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">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="16" Spacing="14">
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<Button
|
||||
Grid.Column="0"
|
||||
Text="◀"
|
||||
WidthRequest="52"
|
||||
HeightRequest="44"
|
||||
Command="{Binding PreviousMonthCommand}" />
|
||||
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedMonthText}"
|
||||
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 NextMonthCommand}" />
|
||||
</Grid>
|
||||
|
||||
<Grid ColumnDefinitions="*,*,*,*,*,*,*">
|
||||
<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 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>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
<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">
|
||||
<ScrollView><VerticalStackLayout Padding="16" Spacing="14">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<Button Grid.Column="0" Text="◀" WidthRequest="52" HeightRequest="44" Command="{Binding PreviousMonthCommand}" />
|
||||
<Label Grid.Column="1" Text="{Binding SelectedMonthText}" 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 NextMonthCommand}" />
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="*,*,*,*,*,*,*">
|
||||
<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 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}"><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>
|
||||
</VerticalStackLayout></ScrollView>
|
||||
</ContentPage>
|
||||
|
||||
+5
-17
@@ -1,20 +1,8 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
using cfs_tracker.ViewModels;
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class MonthPage : ContentPage
|
||||
{
|
||||
private readonly MonthViewModel _viewModel;
|
||||
|
||||
public MonthPage(MonthViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = _viewModel = viewModel;
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
await _viewModel.RefreshAsync();
|
||||
}
|
||||
}
|
||||
private readonly MonthViewModel _vm;
|
||||
public MonthPage(MonthViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
|
||||
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.RefreshAsync(); }
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
<?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"
|
||||
Title="Optionen">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="16" Spacing="16">
|
||||
|
||||
<Label
|
||||
Text="Optionen"
|
||||
FontSize="26"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
<Border
|
||||
Padding="14"
|
||||
BackgroundColor="#FFF4F4"
|
||||
Stroke="#D88"
|
||||
StrokeThickness="1"
|
||||
StrokeShape="RoundRectangle 12">
|
||||
|
||||
<VerticalStackLayout Spacing="12">
|
||||
<Label
|
||||
Text="Datenbank löschen"
|
||||
FontSize="20"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
<Label
|
||||
Text="Dadurch werden alle gespeicherten Einträge unwiderruflich entfernt."
|
||||
FontSize="14" />
|
||||
|
||||
<Label
|
||||
Text="Zur Bestätigung bitte das Wort 'löschen' eingeben."
|
||||
FontSize="14"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
<Entry
|
||||
Placeholder="löschen"
|
||||
Text="{Binding DeleteConfirmationText}" />
|
||||
|
||||
<Button
|
||||
Text="Alle Daten löschen"
|
||||
BackgroundColor="#B00020"
|
||||
TextColor="White"
|
||||
Command="{Binding DeleteAllDataCommand}" />
|
||||
|
||||
<Label
|
||||
Text="{Binding StatusText}"
|
||||
FontSize="13" />
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
@@ -1,12 +0,0 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class OptionsPage : ContentPage
|
||||
{
|
||||
public OptionsPage(OptionsViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = viewModel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
<?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>
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="16" Spacing="16">
|
||||
|
||||
<Label
|
||||
Text="Optionen"
|
||||
FontSize="26"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
<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">
|
||||
<VerticalStackLayout Spacing="12">
|
||||
<Label
|
||||
Text="Alle Einträge löschen"
|
||||
FontSize="18"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
<Label
|
||||
Text="Zur Bestätigung das Wort 'löschen' eingeben." />
|
||||
|
||||
<Entry
|
||||
Placeholder="löschen"
|
||||
Text="{Binding DeleteConfirmationText}" />
|
||||
|
||||
<Button
|
||||
Text="Alle Daten löschen"
|
||||
BackgroundColor="#A85C5C"
|
||||
Command="{Binding DeleteAllDataCommand}" />
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<Label
|
||||
Text="{Binding StatusText}"
|
||||
FontSize="13" />
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,20 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class OptionsPage : ContentPage
|
||||
{
|
||||
private readonly OptionsViewModel _viewModel;
|
||||
|
||||
public OptionsPage(OptionsViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = _viewModel = viewModel;
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
await _viewModel.LoadAsync();
|
||||
}
|
||||
}
|
||||
+21
-93
@@ -1,95 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage
|
||||
x:Class="cfs_tracker.Views.QuickEntryPage"
|
||||
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}" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
<Label
|
||||
IsVisible="{Binding IsFutureDate}"
|
||||
Text="Für zukünftige Tage können keine Einträge gesetzt werden."
|
||||
TextColor="Red"
|
||||
HorizontalTextAlignment="Center" />
|
||||
|
||||
<Grid
|
||||
ColumnDefinitions="*,*"
|
||||
RowDefinitions="Auto,Auto"
|
||||
ColumnSpacing="12"
|
||||
RowSpacing="12">
|
||||
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Text="Grün Gut"
|
||||
FontSize="22"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="120"
|
||||
BackgroundColor="#4CAF50"
|
||||
TextColor="White"
|
||||
Command="{Binding SaveGreenCommand}" />
|
||||
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Text="Gelb So lala"
|
||||
FontSize="22"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="120"
|
||||
BackgroundColor="#FBC02D"
|
||||
TextColor="Black"
|
||||
Command="{Binding SaveYellowCommand}" />
|
||||
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Text="Rot Schlecht"
|
||||
FontSize="22"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="120"
|
||||
BackgroundColor="#E53935"
|
||||
TextColor="White"
|
||||
Command="{Binding SaveRedCommand}" />
|
||||
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Text="Grau Totalausfall"
|
||||
FontSize="22"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="120"
|
||||
BackgroundColor="#757575"
|
||||
TextColor="White"
|
||||
Command="{Binding SaveGrayCommand}" />
|
||||
</Grid>
|
||||
|
||||
<ContentPage x:Class="cfs_tracker.Views.QuickEntryPage"
|
||||
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}" />
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
<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 Gut" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateGreen}" TextColor="White" Command="{Binding SaveGreenCommand}" />
|
||||
<Button Grid.Row="0" Grid.Column="1" Text="Gelb 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 Schlecht" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateRed}" TextColor="White" Command="{Binding SaveRedCommand}" />
|
||||
<Button Grid.Row="1" Grid.Column="1" Text="Grau Totalausfall" FontSize="22" FontAttributes="Bold" HeightRequest="120" BackgroundColor="{StaticResource StateGray}" TextColor="White" Command="{Binding SaveGrayCommand}" />
|
||||
</Grid>
|
||||
</VerticalStackLayout></ScrollView>
|
||||
</ContentPage>
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui.Controls;
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class QuickEntryPage : ContentPage, IQueryAttributable
|
||||
{
|
||||
private readonly QuickEntryViewModel _viewModel;
|
||||
|
||||
public QuickEntryPage(QuickEntryViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = _viewModel = viewModel;
|
||||
}
|
||||
|
||||
public void ApplyQueryAttributes(IDictionary<string, object> query)
|
||||
{
|
||||
query.TryGetValue("date", out var value);
|
||||
_viewModel.SetDateFromQuery(value?.ToString());
|
||||
}
|
||||
}
|
||||
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()); }
|
||||
}
|
||||
|
||||
+30
-106
@@ -1,107 +1,31 @@
|
||||
<?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">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="16" Spacing="14">
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<Button
|
||||
Grid.Column="0"
|
||||
Text="◀"
|
||||
WidthRequest="52"
|
||||
HeightRequest="44"
|
||||
Command="{Binding PreviousWeekCommand}" />
|
||||
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Text="{Binding WeekText}"
|
||||
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="▶"
|
||||
WidthRequest="52"
|
||||
HeightRequest="44"
|
||||
Margin="8,0,0,0"
|
||||
Command="{Binding NextWeekCommand}" />
|
||||
</Grid>
|
||||
|
||||
<CollectionView ItemsSource="{Binding Days}" SelectionMode="None">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
Margin="0,0,0,10"
|
||||
Padding="12"
|
||||
BackgroundColor="White"
|
||||
Stroke="#D0D0D0"
|
||||
StrokeThickness="1"
|
||||
StrokeShape="RoundRectangle 12">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="*" RowSpacing="10">
|
||||
<VerticalStackLayout Grid.Row="0">
|
||||
<Label Text="{Binding DayText}" FontAttributes="Bold" FontSize="18" />
|
||||
<Label Text="{Binding DateText}" FontSize="13" Opacity="0.7" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
<Grid Grid.Row="1" 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>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
<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">
|
||||
<ScrollView><VerticalStackLayout Padding="16" Spacing="14">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||
<Button Grid.Column="0" Text="◀" WidthRequest="52" HeightRequest="44" Command="{Binding PreviousWeekCommand}" />
|
||||
<Label Grid.Column="1" Text="{Binding WeekText}" 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="▶" WidthRequest="52" HeightRequest="44" Margin="8,0,0,0" Command="{Binding NextWeekCommand}" />
|
||||
</Grid>
|
||||
<CollectionView ItemsSource="{Binding Days}" SelectionMode="None">
|
||||
<CollectionView.ItemTemplate><DataTemplate>
|
||||
<Border Margin="0,0,0,10" Padding="12">
|
||||
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="*" RowSpacing="10">
|
||||
<VerticalStackLayout Grid.Row="0">
|
||||
<Label Text="{Binding DayText}" FontAttributes="Bold" FontSize="18" />
|
||||
<Label Text="{Binding DateText}" FontSize="13" TextColor="{StaticResource TextMuted}" />
|
||||
</VerticalStackLayout>
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,*" ColumnSpacing="10">
|
||||
<Border Grid.Column="0" BackgroundColor="{Binding MorningBackgroundColor}" 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}" 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>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate></CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</VerticalStackLayout></ScrollView>
|
||||
</ContentPage>
|
||||
|
||||
+5
-17
@@ -1,20 +1,8 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
using cfs_tracker.ViewModels;
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class WeekPage : ContentPage
|
||||
{
|
||||
private readonly WeekViewModel _viewModel;
|
||||
|
||||
public WeekPage(WeekViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = _viewModel = viewModel;
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
await _viewModel.RefreshAsync();
|
||||
}
|
||||
}
|
||||
private readonly WeekViewModel _vm;
|
||||
public WeekPage(WeekViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
|
||||
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.RefreshAsync(); }
|
||||
}
|
||||
|
||||
+15
-126
@@ -1,127 +1,16 @@
|
||||
<?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="White"
|
||||
Stroke="#D0D0D0"
|
||||
StrokeThickness="1"
|
||||
StrokeShape="RoundRectangle 12">
|
||||
|
||||
<VerticalStackLayout Spacing="10">
|
||||
|
||||
<Label
|
||||
Text="{Binding MonthText}"
|
||||
FontSize="20"
|
||||
FontAttributes="Bold" />
|
||||
|
||||
<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>
|
||||
<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"><VerticalStackLayout Spacing="10"><Label Text="{Binding MonthText}" FontSize="20" FontAttributes="Bold" /><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}"><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>
|
||||
|
||||
+5
-17
@@ -1,20 +1,8 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
using cfs_tracker.ViewModels;
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class YearPage : ContentPage
|
||||
{
|
||||
private readonly YearViewModel _viewModel;
|
||||
|
||||
public YearPage(YearViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = _viewModel = viewModel;
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
await _viewModel.RefreshAsync();
|
||||
}
|
||||
}
|
||||
private readonly YearViewModel _vm;
|
||||
public YearPage(YearViewModel vm){ InitializeComponent(); BindingContext = _vm = vm; }
|
||||
protected override async void OnAppearing(){ base.OnAppearing(); await _vm.RefreshAsync(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user