Problem with Empty Json

Cannot create Object, when zeit_total_daily is empty
This commit is contained in:
2024-08-21 20:17:26 +02:00
parent f0b47f5249
commit 13db083891
3 changed files with 83 additions and 2 deletions

View File

@@ -34,6 +34,11 @@ namespace Jugenddienst_Stunden.ViewModels {
public string OvertimeMonth {
get => _hour.overtime_month;
}
public Dictionary<int, decimal> ZeitTotalDaily {
get => _hour.zeit_total_daily;
}
public string Title { get; set; } = Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", "");
public StundenViewModel() {
@@ -46,7 +51,7 @@ namespace Jugenddienst_Stunden.ViewModels {
public async Task LoadData() {
_hour = await Models.Stunde.LoadData();
Models.Hours Hours = new Models.Hours();
//Models.Hours Hours = new Models.Hours();
//Title = _hour.operator_api.name + " " + _hour.operator_api.surname;
RefreshProperties();
}
@@ -59,6 +64,7 @@ namespace Jugenddienst_Stunden.ViewModels {
OnPropertyChanged(nameof(ZeitDone));
OnPropertyChanged(nameof(Hours));
OnPropertyChanged(nameof(Title));
OnPropertyChanged(nameof(ZeitTotalDaily));
}