Started working on main page

This commit is contained in:
2025-11-12 20:12:03 +01:00
parent e0bf95060a
commit 969219137a
148 changed files with 1053 additions and 93 deletions

View File

@@ -0,0 +1,48 @@
using CommunityToolkit.Mvvm.Input;
namespace WorkTime.Mobile.Pages.Components;
public partial class DateSelector : ContentView {
public static readonly BindableProperty CurrentDateProperty = BindableProperty.Create(
nameof(CurrentDate),
typeof(DateTime),
typeof(DateSelector),
DateTime.Now);
public static readonly BindableProperty MaxDateProperty = BindableProperty.Create(
nameof(MaxDate),
typeof(DateTime),
typeof(DateSelector),
DateTime.Now);
public static readonly BindableProperty CommandProperty = BindableProperty.Create(
nameof(Command),
typeof(IRelayCommand<DateOnly>),
typeof(DateSelector));
public DateTime CurrentDate {
get => (DateTime)GetValue(CurrentDateProperty);
set => SetValue(CurrentDateProperty, value);
}
public DateTime MaxDate {
get => (DateTime)GetValue(MaxDateProperty);
set => SetValue(MaxDateProperty, value);
}
public IRelayCommand<DateOnly>? Command {
get => (IRelayCommand<DateOnly>)GetValue(CommandProperty);
set => SetValue(CommandProperty, value);
}
public DateSelector() {
InitializeComponent();
}
private void OnDateSelected(object? sender, DateChangedEventArgs e) {
var date = DateOnly.FromDateTime(CurrentDate);
Command?.Execute(date);
}
}