d85f2e0fb3
Bootstraper läd jetzt die farbeinstellung sofort und nicht nachträglich cleanup and rework PDF switch to HTML export fix Colorsystem Farben für knöpfe hinzugefügt als anpassung button color button color primary and secondary change
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using Microsoft.Maui.Graphics;
|
|
|
|
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));
|
|
}
|
|
}
|