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
42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
namespace cfs_tracker.ViewModels;
|
|
|
|
public partial class WeekDaySummaryViewModel : ObservableObject
|
|
{
|
|
public DateTime Date { get; init; }
|
|
public string DateText { get; init; } = string.Empty;
|
|
public string MorningText { get; init; } = "-";
|
|
public string AfternoonText { get; init; } = "-";
|
|
public Color MorningColor { get; init; } = Colors.Transparent;
|
|
public Color AfternoonColor { get; init; } = Colors.Transparent;
|
|
public string ActivitiesText { get; init; } = string.Empty;
|
|
public string SymptomsText { get; init; } = string.Empty;
|
|
public bool HasDetails => !string.IsNullOrWhiteSpace(ActivitiesText) || !string.IsNullOrWhiteSpace(SymptomsText);
|
|
public bool HasActivities => !string.IsNullOrWhiteSpace(ActivitiesText);
|
|
public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText);
|
|
public string DetailsButtonText => IsExpanded ? "Zusammenfassung ausblenden" : "Zusammenfassung anzeigen";
|
|
|
|
[ObservableProperty]
|
|
private bool isExpanded;
|
|
|
|
public IRelayCommand ToggleExpandedCommand { get; }
|
|
|
|
public WeekDaySummaryViewModel()
|
|
{
|
|
ToggleExpandedCommand = new RelayCommand(() =>
|
|
{
|
|
if (!HasDetails)
|
|
return;
|
|
|
|
IsExpanded = !IsExpanded;
|
|
});
|
|
}
|
|
|
|
partial void OnIsExpandedChanged(bool value)
|
|
{
|
|
OnPropertyChanged(nameof(DetailsButtonText));
|
|
}
|
|
}
|