2024-12-28 23:17:16 +01:00
|
|
|
|
using System;
|
2025-01-16 22:00:05 +01:00
|
|
|
|
using System.Collections.ObjectModel;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
|
using Itenso.TimePeriod;
|
2024-12-29 19:37:36 +01:00
|
|
|
|
using Wino.Core.Domain.Entities.Calendar;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
using Wino.Core.Domain.Interfaces;
|
|
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
namespace Wino.Calendar.ViewModels.Data;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public partial class CalendarItemViewModel : ObservableObject, ICalendarItem, ICalendarItemViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public CalendarItem CalendarItem { get; }
|
2024-12-28 23:17:16 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public string Title => CalendarItem.Title;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public Guid Id => CalendarItem.Id;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public IAccountCalendar AssignedCalendar => CalendarItem.AssignedCalendar;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public DateTime StartDate { get => CalendarItem.StartDate; set => CalendarItem.StartDate = value; }
|
2024-12-28 23:17:16 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public DateTime EndDate => CalendarItem.EndDate;
|
2024-12-30 23:10:51 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public double DurationInSeconds { get => CalendarItem.DurationInSeconds; set => CalendarItem.DurationInSeconds = value; }
|
2024-12-29 19:37:36 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public ITimePeriod Period => CalendarItem.Period;
|
2025-01-02 00:18:34 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public bool IsAllDayEvent => CalendarItem.IsAllDayEvent;
|
|
|
|
|
|
public bool IsMultiDayEvent => CalendarItem.IsMultiDayEvent;
|
|
|
|
|
|
public bool IsRecurringEvent => CalendarItem.IsRecurringEvent;
|
|
|
|
|
|
public bool IsRecurringChild => CalendarItem.IsRecurringChild;
|
|
|
|
|
|
public bool IsRecurringParent => CalendarItem.IsRecurringParent;
|
2025-01-02 00:18:34 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
[ObservableProperty]
|
|
|
|
|
|
private bool _isSelected;
|
2025-01-16 22:00:05 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public ObservableCollection<CalendarEventAttendee> Attendees { get; } = new ObservableCollection<CalendarEventAttendee>();
|
2025-01-04 11:39:32 +01:00
|
|
|
|
|
2025-05-18 14:06:25 +02:00
|
|
|
|
public CalendarItemViewModel(CalendarItem calendarItem)
|
|
|
|
|
|
{
|
|
|
|
|
|
CalendarItem = calendarItem;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
}
|
2025-05-18 14:06:25 +02:00
|
|
|
|
|
|
|
|
|
|
public override string ToString() => CalendarItem.Title;
|
2024-12-28 23:17:16 +01:00
|
|
|
|
}
|