First version
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
<?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">
|
||||
|
||||
<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}" />
|
||||
</Grid>
|
||||
|
||||
<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">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Grün" 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">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Gelb" FontAttributes="Bold" />
|
||||
<Label Text="{Binding YellowCount}" FontSize="22" />
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="0" BackgroundColor="#E53935" StrokeThickness="0" StrokeShape="RoundRectangle 12" Padding="12">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Rot" 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">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="Grau" TextColor="White" FontAttributes="Bold" />
|
||||
<Label Text="{Binding GrayCount}" TextColor="White" FontSize="22" />
|
||||
</VerticalStackLayout>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
<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">
|
||||
|
||||
<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" />
|
||||
<Label Text="{Binding SourceText}" TextColor="{Binding TextColor}" FontSize="12" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
Text="X"
|
||||
WidthRequest="44"
|
||||
HeightRequest="44"
|
||||
Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.DeleteEntryCommand}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,20 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class DayPage : ContentPage
|
||||
{
|
||||
private readonly DayViewModel _viewModel;
|
||||
|
||||
public DayPage(DayViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = _viewModel = viewModel;
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
await _viewModel.RefreshAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,12 @@
|
||||
using cfs_tracker.ViewModels;
|
||||
|
||||
namespace cfs_tracker.Views;
|
||||
|
||||
public partial class OptionsPage : ContentPage
|
||||
{
|
||||
public OptionsPage(OptionsViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
BindingContext = viewModel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?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>
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,21 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user