2b0797f50f
Linked colors to options menu Options extension Aussehen aufgebohrt: - erlaubt text von status zu ändern, - bessere beschriftung von Farben desing änderung und bedienung - heute status felder anklickbar, - Farbpalette verdunkelt und kontrast reduziert - Kalender Tage anklickbar gemacht - Optionen überarbeitet
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using Microsoft.Maui.Graphics;
|
|
|
|
namespace cfs_tracker.ViewModels;
|
|
|
|
public partial class DayEntryItemViewModel : ObservableObject
|
|
{
|
|
public int Id { get; init; }
|
|
|
|
public string TimeText { get; init; } = string.Empty;
|
|
public string StateText { get; init; } = string.Empty;
|
|
|
|
public string ActivityText { get; init; } = string.Empty;
|
|
public string SymptomsText { get; init; } = string.Empty;
|
|
|
|
public bool HasActivity => !string.IsNullOrWhiteSpace(ActivityText);
|
|
public bool HasSymptoms => !string.IsNullOrWhiteSpace(SymptomsText);
|
|
public bool HasDetails => HasActivity || HasSymptoms;
|
|
|
|
public string FoldoutText => IsExpanded ? "Details ausblenden" : "Details anzeigen";
|
|
|
|
public Color BackgroundColor { get; init; } = Colors.Transparent;
|
|
public Color TextColor { get; init; } = Colors.White;
|
|
|
|
[ObservableProperty]
|
|
private bool isExpanded;
|
|
|
|
public IRelayCommand ToggleExpandedCommand { get; }
|
|
|
|
public DayEntryItemViewModel()
|
|
{
|
|
ToggleExpandedCommand = new RelayCommand(ToggleExpanded);
|
|
}
|
|
|
|
private void ToggleExpanded()
|
|
{
|
|
if (!HasDetails)
|
|
return;
|
|
|
|
IsExpanded = !IsExpanded;
|
|
OnPropertyChanged(nameof(FoldoutText));
|
|
}
|
|
} |