Add DateBinding to Datepicker

And keep order
This commit is contained in:
2024-09-08 16:15:34 +02:00
parent b06ea066fd
commit b51984066b
6 changed files with 92 additions and 54 deletions

View File

@@ -9,9 +9,8 @@ using System.ComponentModel;
using Jugenddienst_Stunden.Types;
namespace Jugenddienst_Stunden.ViewModels
{
internal class StundenViewModel : ObservableObject {
namespace Jugenddienst_Stunden.ViewModels {
internal class StundenViewModel : ObservableObject {
public string Name => AppInfo.Name;
public string Surname => AppInfo.VersionString;
public string MoreInfoUrl => "https://aka.ms/maui";
@@ -19,8 +18,19 @@ namespace Jugenddienst_Stunden.ViewModels
public ICommand LoadDataCommand { get; private set; }
public object Stunden { get; }
private Models.Hours _hour;
public Models.Hours Hours {
/* Nicht gemergte Änderung aus Projekt "Jugenddienst Stunden (net8.0-ios)"
Vor:
private Models.Hours _hour;
public Models.Hours Hours {
get => _hour;
Nach:
private Hours _hour;
public Hours Hours {
get => _hour;
*/
private Types.Hours _hour;
public Types.Hours Hours {
get => _hour;
}
public string ZeitDone {
@@ -39,6 +49,22 @@ namespace Jugenddienst_Stunden.ViewModels
get => _hour.overtime_month;
}
public DateTime MinimumDate {
//get => _hour.MinDate;
get => DateTime.Today.AddDays(-21);
}
public DateTime MaximumDate {
//get => _hour.MaxDate;
get => DateTime.Today.AddDays(5);
}
public DateTime DateToday {
//get => _hour.Today;
get => DateTime.Today;
}
public DateTime Date {
get => _hour.Date;
}
//public Dictionary<int, decimal> ZeitTotalDaily {
// get => _hour.zeit_total_daily;
//}
@@ -85,9 +111,9 @@ namespace Jugenddienst_Stunden.ViewModels
"Krankheit",
"Elternzeit"
};
_hour = new Models.Hours();
_hour = new Types.Hours();
LoadDataCommand = new AsyncRelayCommand(LoadData);
}
//protected void OnPropertyChanged(string propertyName) {
@@ -123,6 +149,9 @@ namespace Jugenddienst_Stunden.ViewModels
OnPropertyChanged(nameof(Title));
OnPropertyChanged(nameof(ZeitTotalDaily));
OnPropertyChanged(nameof(TimeDay));
OnPropertyChanged(nameof(MinimumDate));
OnPropertyChanged(nameof(MaximumDate));
OnPropertyChanged(nameof(DateToday));
}