d11f0e46c0
clean up and fixes - Heute gefixt - Code Cleanup NotificationScheduleItemViewModel -fixed NotificationScheduleItemViewModel for Windows compat push implementation Push fixes Push benachrichtungen eingebaut - Status bei push - Push auch in background - Toggle für symtome angepasst push system change exporter update Optionen fix - Optionen aufgeteilt auf 3 tabs - Anpassungen haben jetzt Farbslider Optimierung fix
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
namespace cfs_tracker.ViewModels;
|
|
|
|
public partial class DayEntryItemViewModel : ObservableObject
|
|
{
|
|
public int Id { get; init; }
|
|
public DateTime Date { get; init; }
|
|
public string SlotText { get; init; } = string.Empty;
|
|
public string StateText { get; init; } = string.Empty;
|
|
public string ActivityText { get; init; } = string.Empty;
|
|
public string DurationText { get; init; } = string.Empty;
|
|
public string SymptomsText { get; init; } = string.Empty;
|
|
public bool IsBackfill { get; init; }
|
|
public Color StateColor { get; init; } = Colors.Transparent;
|
|
public Color ForegroundColor { get; init; } = Colors.White;
|
|
|
|
public bool HasActivity => !string.IsNullOrWhiteSpace(ActivityText);
|
|
public bool HasDuration => !string.IsNullOrWhiteSpace(DurationText);
|
|
public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText);
|
|
public bool HasDetails => HasActivity || HasDuration || HasSymptoms;
|
|
public string DetailsButtonText => IsExpanded ? "Details ausblenden" : "Details anzeigen";
|
|
|
|
[ObservableProperty]
|
|
private bool isExpanded;
|
|
|
|
public IRelayCommand ToggleExpandedCommand { get; }
|
|
|
|
public DayEntryItemViewModel()
|
|
{
|
|
ToggleExpandedCommand = new RelayCommand(ToggleExpanded);
|
|
}
|
|
|
|
partial void OnIsExpandedChanged(bool value)
|
|
{
|
|
OnPropertyChanged(nameof(DetailsButtonText));
|
|
}
|
|
|
|
private void ToggleExpanded()
|
|
{
|
|
if (!HasDetails)
|
|
return;
|
|
|
|
IsExpanded = !IsExpanded;
|
|
}
|
|
} |